Bash script for automatic website data backup with rclone and Backblaze B2. The script uploads a zip file of the complete /var/www directory with the zip filename consisting of the date and time it was uploaded.
- Create a B2 bucket
- Enter your home directory
$ cd ~ - Clone the repository with
$ git clone https://github.com/wouterbles/rclone-backup.git - Run the setup script which downloads and installs rclone with
$ rclone-backup/setup.sh - The rclone config processs will be opened automatically, select B2 and insert the API keys
- Set the bucket name in a
.envfile withB2_BUCKET_NAME=bucket-name-here, file should be located in therclone-backupfolder - Add a cron job for
script.shwith$ crontab -e
Example cron job: @weekly ~/rclone-backup/script.sh, for weekly backups and in the case that the repository was cloned to the home directory.
- Add MySQL and other database support
- Automatically setup cron job
- Let the user determine their own install location, currently limited to home directory
- Add backup retention time specified by the user
- Check compatibility with other remotes (Google Drive, Amazon S3, OneDrive...)