Here is a little bit of shell script as a crontab that you can use to automate the checking of Ksplice kernel updates. This particular one does the following:
- Activates at midnight every day, server time
- Checks if there are updates
- If there are updates available to the kernel, to automatically apply the update
- Once the update is applied, email the updates applied to the specified email address “[email protected]”
This script does not output anything if there are no updates to apply. Happy scripting!
0 0 * * * uptrack=`/usr/sbin/uptrack-upgrade -y`; uptrackCheck=`echo $uptrack | grep -o "Nothing to be done."`; if [[ $uptrackCheck != "Nothing to be done." ]]; then echo "$uptrack" | mail -s "Ksplice kernel upgraded" [email protected]; fi;
Some things that you can do to make it more interesting:
- Also have it send you a text message on your phone, by emailing the SMS gateway of your service provider
- Check more often, by modifying the crontab entry (don’t make it too often that you get blacklisted for abuse!)