A simple Ruby script to back up MySQL databases, MongoDB databases, full directories, and groups of single files to any FTP host. It's a "handsoff" script, the most is done for you.
Features
- Database backup (MySQL, MongoDB)
- Directory backup
- Subdirectories backup
- File backup
- Split files
- Set compression rate (now on all backup types)
- FTP error catching
- Days of archive cleanup
- Backups ordered in buckets and daily folders
- Archives symlinks as file or the target files
- Option for ignoring failed reads
Steps for using:
- Set up your FTP server
- Get the script: git clone https://github.com/cubetech/simple-ftp-backup.git
- Install the gems via Bundler, or install the gems listed in Gemfile manually.
- Rename settings.rb.sample to settings.rb
- In settings.rb, fill in specific command paths, FTP credentials, MySQL login info & databases, and any directories you want backed up. Just comment out the constants for backups you don't want to run.
- Set the script to run with cron - I have mine run every night, like so:
15 3 * * * /usr/local/simple-ftp-backup/simple-ftp-backup.rb
To do:
- Improvements with the file structure