wrapper script for cron jobs on notebooks

This script becomes handy when scheduling CPU-/IO-intensive task on a notebook that additionally require Internet access (ex. backups).

Obviously a notebook is not online and not on AC all the time - so why not defer the started jobs until the system is back online and on AC again?

Usage:

  1. Download the script and save it to a place of your preference
  2. Set the variable AC_REFERENCE accordingly (just browse /sys and you will find something to determine the presence of your charger)
  3. In your [f|ana]crontab, prefix your commands with the script above:
# old:
09 5 * * * ~/backup_server.sh
# new:
09 5 * * * ~/notebook_cron_wrapper.sh ~/backup_server.sh

Enjoy.