Backup agent for files and databases, sync to Google Cloud or Amazon AWS

Started by hebron, August 02, 2014, 07:23:53 PM

Previous topic - Next topic

hebron

Thought I could share the backup solution I use on my server hosting SMF, it's a Python script I've named Snotra-backup. In Norse mythology, Snotra (Old Norse "clever") is a goddess associated with wisdom. It uses duplicity and mysqldump to back-up and encrypt files, folders and databases. And it can sync the backup folder with wither Google Cloud Storage or Amazon AWS, or both.

Some sample configurations:

# * Make folder /tmp/db
# * Dump databases: 'my_website' and 'mysql' to /tmp/db
# * Run duplicity backup on /tmp/db and store in /backup/db
# * Remove folder /tmp/db

# Name of definition (required).
[database]
# Turn on/off definition (required).
enabled = true
# Folder to back-up (required).
source = /tmp/db
# Target folder, appended to global 'target_folder'. Set to 'source' if not defined.
target = /db
# Comma separated list of databases to dump, will be placed in 'source' folder.
database = my_website, mysql
# Comma separated list of command to execute before executing any backup steps.
pre_action = mkdir %(source)s
# Comma separated list of commend to execute after backup has been executed.
post_action = rm -rf %(source)s

# Run duplicity backup on /etc and store in /backup/etc
[etc]
enabled = true
source  = /etc


By using the pre/post_actions it is possible to get the script to put the forum into maintenance mode before starting, and putting it back when done with the respective backup definition. As is described in this backup solution: http://www.simplemachines.org/community/index.php?topic=293441.0

The script can be found at GitHub: https://github.com/HebronNor/Snotra-backup

It's still in it's early stages :)

kat

Not something I'd use, myself. Trusting my data to Google or Amazon just doesn't fill me with good feelings. ;)

But, thanks for sharing this! :)

hebron

Quote from: K@ on August 06, 2014, 11:37:30 AM
Not something I'd use, myself. Trusting my data to Google or Amazon just doesn't fill me with good feelings. ;)

But, thanks for sharing this! :)
I share your privacy concerns, which is why everything is GPG encrypted before uploading 8) But the feature can be turned off altogether:


# gsutil
#
gsutil_enabled = true

# s3cmd
#
s3cmd_enabled = false


I am thinking of including the option of specifying a custom sync script in the next version, so the user can do or upload the files where every he wants :)

kat

Now that sounds interesting!

Please, keep us updated, won't you? :)

ApplianceJunk

Quote from: K@ on August 06, 2014, 11:37:30 AM
Not something I'd use, myself. Trusting my data to Google or Amazon just doesn't fill me with good feelings. ;)

But, thanks for sharing this! :)

You sound like my dad. ;)
It's one think not to trust others with your data, but when you can't even trust yourself with it you maybe should think about trusting someone.

I bet in the last ten years my dad has had three HD's fail that I can recall and no working backups.

hebron

Quote from: K@ on August 06, 2014, 05:03:20 PM
Now that sounds interesting!

Please, keep us updated, won't you? :)
I will :)

I just pushed new source to GitHub, with support for multiple backends; file, ftp and ssh. Cloud sync and custom command is only available for file backend. Since the others upload directly to a remote source. But be warned, the ftp and ssh backends is highly experimental at this point.

Time for bed :)

青山 素子

If you have server access, JungleDisk is a great service. I use it on my server and it's served me well. It's also very low cost, supports local encryption and can use Rackspace's CloudFiles (10GB base storage free in the monthly cost) or Amazon AWS to store the backups. I combine that with Holland Backup Manager to snapshot MySQL nightly and then make sure the directory it uses for backups is included in the JungleDisk backup.
Motoko-chan
Director, Simple Machines

Note: Unless otherwise stated, my posts are not representative of any official position or opinion of Simple Machines.




Advertisement: