Backup to Gmail
I have been looking around for a good way to back my data up to a remote server, and since switching over to my Mac this only got harder. Everything that I have found still had problems with the 10Mb gmail attachment limit. Well again with a little help from Ken, and a script that he had for creating backups and emailing them to gmail. In that script it was using uuencode to encode the attachment and insert it as the body of the email. It also didn’t split up anything over 10Mb. His script did however do a mySQL dump to a tarred bzip file, as well as tar and bzip whatever directory you wanted. Now I was playing around with splittingup the huge bzip file that I ended up with (it was about 300Mb).
I had tried using tar to split the files up but then I needed to know how many pieces there were going to be and pump in the filenames. That was too much work. Another avenue was split, but there was no encryption or protection on the files. Then from my experiences with torrents, I started looking into rar. This seemed promising. It would split up the file into pieces of a size of my choosing and it could be encrypted with a password.
Now to deal with the emailing issues. Using uuencode was ok but it was a pain if you had to get that data back for any reason. While still looking for a solution to this issue we had stubmled across somebody using mutt to send mail for backups. After looking into the command line syntax of mutt we finally came up with a good way of sending the emails with a decent subject line, and with the rar file as an attachment.
Now this isn’t foolproof and there is no error checking going on so if something fails, oops. Another issue is that you end up with a bunch of emails on gmail that need to manually be downloaded. you also need to manually go into gmail and delete the backups every once and a while so that you don’t fill up your gmail account.
