Tiny Core Linux – Part 2 – Cron and Back-Up

As mentioned in previous post, changes are only backed up manually by running the filetool.sh -b command. Which is fine for scheduled shut-downs but what about power cuts and such?

The most straight forward option is to run the filetool.sh -b command on a schedule, which is where cron comes in. You need to enable to cron daemon at start-up (see more options at http://www.tinycorelinux.net/faq.html#bootcodes). As per http://ostatic.com/blog/thinking-small-with-tiny-core-linux, you need to edit  /mnt/sdb/boot/syslinux/syslinux.cfg to add cron to the boot parameters list under APPEND. At the next reboot, the cron daemon will be running.

Then you need to edit the crontab (sudo crontab -e, see here for vi basics – http://www.washington.edu/computing/unix/vi.html).

*/15 * * * * filetool.sh -b > /home/tc/cron.log

This will run the filetool.sh -b command every 15 minutes and log it in /home/tc/cron.log so I can actually confirm it is running.

You then need to add/var/spool/cron to /opt/.filetool.lst file in order for your cron job to be backed up.

Advertisements