Ruby for backing up
Backup, backup, backup! That’s the motto of the day and its good one to live by, for everyone. I personally know that I do not backup as much as I should but that’s mainly because I don’t believe that you can ever backup too much. For my personal computers I use a cobbled together version of syncing and cloud backup for all my syncing but my server is setup a bit different. For the past 6 months or so I’ve been using a ruby script that I put together from various sources to backup. Its fairly simple but it works perfectly for my purposes so I thought I would share it for anyone who wants it.
Anyone who has a bit of knowledge in programming should be able to easily modify and update the script to fit your needs but even for a novice it shouldn’t be too bad. To set it up out of the box just read through the comments in backup_config.rb and change the values as you wish to. After doing this, update folderlist.txt with all the directories you want backed up. After you have modified these two files all you have to do is run ‘ruby full_backup.rb’ and the script should output a tarball of your files where you chose to have your files backed up to. If you don’t need a MySQL backup, just change the variable appropriately in the configuration. At this point you can transfer this to an external drive or drop it on a remote server. Personally, I recommend having it upload to a server but that’s your choice, as long its off the drive you should be fine. There is a README file in the folder that should get you started.
If you have any questions, suggestions or comments please let me know, I’d be glad to help anyone out with this.
Click here to download version 0.2