Using Gmail for Backups
While writing a thesis it is obviously imperative to have foolproof backups in place. So why not backup to that free 2.7Gb Gmail account? Here’s what you have to do:
- Install “email” (Gentoo users:
emerge net-mail/email) - Edit
/etc/email/email.conf(Gentoo users: as a minimum you must setREPLY_TO) - Test the commands. They are:
cd /path/to/your/thesis/
tar -czf /tmp/thesis.tar.gz *.*
email --blank-mail --smtp-server mail.yourserver.com –from-name “your name” –from-addr you@youremail.com –subject “Cron: Thesis Backup (`date`)” you@gmail.com –attach /tmp/thesis.tar.gz > /dev/null 2>&1
rm -f /tmp/thesis.tar.gz
- Now add this as a
/etc/crontabentry. This example sends the backup at 7am each day.
0 7 * * * unixusername cd /path/to/your/thesis/; tar -czf /tmp/thesis.tar.gz *.*; email –blank-mail –smtp-server mail.yourserver.com –from-name “your name” –from-addr you@youremail.com –subject “Cron: Thesis Backup (`date`)” you@gmail.com –attach /tmp/thesis.tar.gz > /dev/null 2>&1; rm -f /tmp/thesis.tar.gz
- Final step is to create a Gmail filter! It would be nice if it was possible to stop the emails being downloaded via POP but I think this may require a filter that moves the incoming backup emails to Trash.
Obviously you don’t have to use this for backing up a thesis, it could easily be modified to backup whatever you want.
Note: I can’t see mention of TLS support in the client email, so that’s why I’ve suggested you use your own SMTP server rather than Google’s.
May 3rd, 2006 at 10:46 am
I think you can only backup files that are less than 10MB.