Dropbox + Cron

Dropbox allows you to simply and easily share files across multiple computers. It doesn’t matter if you have a Windows, Linux or Mac computer or even an iPhone. It just seamlessly works! Shared directories and files appear within a Dropbox folder and are accessible like any other local file folder. Shared directories and files are also accessible via a web browser using dropbox.com.

I use cron under Ubuntu to schedule shell commands to run periodically. Setup crontab file to be synchronized and backed up via Dropbox.

1) Move crontab file and dependencies to ~/Dropbox/schedule folder

2) I created ~/schedule/backup_dropbox file to backup Dropbox locally
date=`date -I`
tar -czvf ~/backup/dropbox-$date.tgz ~/Dropbox

3) Add Dropbox backup to ~/Dropbox/schedule/crontab
05 16 * * * ~/Dropbox/schedule/backup_dropbox

4) Add Dropbox backup clean up (for all files older than 10 days)
20 16 * * * find ~/backup -type f -daystart -ctime +10 -exec rm -f {} \;

5) Remember to reload crontab file to schedule latest changes
crontab ~/Dropbox/schedule/crontab

6) Verify schedule
crontab -l