Auto Backuper is a BASH script which can be used to backup PostgreSQL databases and given files/folders.
It's written in BASH scripting language and only needs cURL.
- Simple configuration, all configurations in one place: backup.info
- Sets up daily and weekly CRON jobs
- Uploads backup files directly to Dropbox
- Cleans up after itself, deletes older files
WARNING: to be able run crons with postgres user, DO NOT place this script in /root directory!
First, clone the repository using git (recommended):
git clone https://github.com/msadig/Auto-Backuperor download the script manually using this command:
curl "https://raw.githubusercontent.com/msadig/Auto-Backuper/master/backuper.sh" -o backuper.shTo configure:
$ bash ./backuper.sh setup
$ nano ./backup.confThe first time you run ./backuper.sh setup, you'll be guided through a wizard in order to configure access to your Dropbox. For more info visit - https://github.com/andreafabrizi/Dropbox-Uploader
The syntax is quite simple:
bash ./backuper.sh COMMAND
Available commands:
-
setup
Sets up script -
database
Backs up PostgreSQL database and uploads to the Dropbox (to the described folder inbackup.conf). -
daily
To backup only today's files and directories and upload to Dropbox. -
weekly
To backup all files and directories and upload to Dropbox. -
cronit
To set up CRON jobs -
getmail
Get mail.sh file
Examples:
bash ./backuper.sh setup
bash ./backuper.sh database
bash ./backuper.sh daily
bash ./backuper.sh weeklyIf you want to configure crontab send mail when task fails, then please follow the step-by-step instructions below:
$ bash ./backuper.sh getmail
$ sudo bash ./mail.sh setup
$ bash ./mail.sh cronmail- GNU Linux
- MacOSX