lisenet / crypt-backup-to-ftps

Upload Encrypted (MySQL) Backups to Remote FTPS Server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

crypt-backup-to-ftps

The script dumps a MySQL database and an htdocs folder, gzips them and encrypts with a public GPG key, calculates a SHA1 hash of the database backup file and then uploads files to a remote FTPS server.

After the upload is done, the script downloads the uploaded database file back from the FTPS server and calculates a SHA1 hash, then compares it with the original backup file. An email is sent regardless of the outcome (whether the hashes are the same or different).

Installation on Debian Wheezy

The following packages are used by the script:

  • Gzip
  • GPG
  • FTP-SSL
  • Heilroom-mailx

To install:

# apt-get install gzip gpgv ftp-ssl heirloom-mailx

FTP client uses the ~/.netrc file for authentication which looks like this:

machine ftp.example.com login ftp_user password ftp_password

About

Upload Encrypted (MySQL) Backups to Remote FTPS Server

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:Shell 100.0%