Backup PostgreSQL DB and copy file to Dropbox.
-
Make file .pgpass with rights 0600 in home directory for the user who will run the script. Format:
hostname:port:database:username:password
-
Add backup.sh to cron for periodical backup
-
Make directory for backups and logs.
-
Install dropbox module for Python3
pip3 install dropbox