So, you got email working. However, when cronie or crond is running you see no email. journalctl -f shows the script executing, but nothing in email. answer is check that crond has “inotify” message. If crond is started without an active mailserver MTA – it needs to be restarted. r 04 19:46:01 jons-bad-ass-fedora-server-37 CROND[3012]: (jon2allen) CMD (/home/jon2allen/every_two.sh) Apr 04 19:46:01 […]
Fedora 37 server – cron email notification not working
VirtManager/KVM – Security Driver Module not available.
I had a problem with a VM image I created with Gnome boxes. It had SELinux enabled. I was able to get around it by taking out this line in the XML. You can do this in VirtManager. It was the last entry </video> <redirdev bus=”usb” type=”spicevmc”> <address type=”usb” bus=”0″ port=”3″/> </redirdev> <redirdev bus=”usb” type=”spicevmc”> <address type=”usb” bus=”0″ port=”4″/> […]
FreeBSD – increasing size of root disk with KVM/QEMU
Here is how to to increase the size of the disk for FreeBSD. I am using FreeBSD 12.3 here running inside a Fedora Linux. Here are some starting requirements One needs to have qcow2 type disk. the virtual machine must be shutdown No snapshots against the virtual machine So, I cloned out the machine to test: [jon2allen@fedora Downloads]$ ll freebsd*.qcow2 […]
Find command – listing last modify path with full dir
Some examples of this command from Linux Debian and FreeBSD Here is how to do this with GNU Linux – %p gives full path name user1@f1-google-joniowa:~$ find . -name “weather_obs.log” -printf “%p\t%TY-%Tm-%Td\n” ./test27/weather_obs/weather_obs.log 2023-05-16 ./test26/weather_obs/weather_obs.log 2022-12-08 ./test28/weather_obs/weather_obs.log 2023-02-28 ./test25/weather_obs/weather_obs.log 2022-08-18 ./python/weather_obs/weather_obs.log 2021-05-24 ./test24/weather_obs/weather_obs.log 2022-11-22 Here is a bsd version – uses exec [user1@freebsd12_3 ~]$ find . -name […]
finding files and using tar for backup.
The most common solution is to use find with xargs to backup Something like this: find /var/www/html/ -type f -name my*.csv -print0 | xargs -0 tar cfvzP /backupdir/backupfile The more files you have, especially over 1000 – this will produce weird results. Number of files in the archive doesn’t match the output of the find xargs will split the input […]
FreeBSD – setting up serial logins with Linux/KVM
FreeBSD – virsh serial howto Goal is to setup FreeBSD so you can connect to virtual serial port for login Add serials to KVM instance. Use Virtual Manager one is usually the default – you can add up to 3 more. In the virtual FreeBSD machine, edit the /etc/ttys Change the 3wire/ ttyu0 to std.9600. Secure means root can login […]
Use sed command to change column names in csv files
Problem: – You have several CSV file that have a title that needs to change. In my example I had a column name that was need to change from “Time(edt)” to just “Time” To run a test: note: no special backslash needed for “(” or “)” You can glob the files and it will do all of them. sed ‘s/Time(edt)/Time/g’ […]
Updating Jessie Debian in 2022
I had this old Virtual machine running Jessie. Turnkey Linux/Debian root@TurnkeyLamp apt/sources.list.d$ uname -a Linux TurnkeyLamp 3.16.0-6-amd64 #1 SMP Debian 3.16.56-1+deb8u1 (2018-05-08) x86_64 GNU/Linux In order to update add check-valid-until=no to the archive Debian repository deb http://archive.turnkeylinux.org/debian jessie main deb [check-valid-until=no] http://archive.debian.org/debian jessie-backports main deb http://httpredir.debian.org/debian jessie main deb http://httpredir.debian.org/debian jessie contrib # deb http://httpredir.debian.org/debian jessie non-free Stack exchange link
Bash array operations – short table.
arr=() Create an empty array arr=(1 2 3) Initialize array ${arr[2]} Retrieve third element ${arr[@]} Retrieve all elements ${!arr[@]} Retrieve array indices ${#arr[@]} Calculate array size arr[0]=3 Overwrite 1st element arr+=(4) Append value(s) str=$(ls) Save ls output as a string arr=( $(ls) ) Save ls output as an array of files ${arr[@]:s:n} Retrieve n elements starting at index s
Bash – using mailx command to parse subjects
Problem: It appears that the default mail -H appears to truncate the subject. Grep fails to find text pass the email address. Fix: Use Headline to format echo ‘f 1-$’ | mail -H -S headline=”%>%a%m %20f %16d %3l/%-5o %i%150S” | grep -i ANZ535 | wc -l Here is what the issue looks like [ec2-user@jibsheet data]$ echo ‘f 1-$’ | […]