-
-
Save eignatov/e8ebe2e50afaceb36d9cf7f8fdca1603 to your computer and use it in GitHub Desktop.
Backup gziped postgresql dump to a ftp server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# shell command: | |
pg_dump <db_name> -U <db_user> -h <db_host> | gzip | curl -u <ftp_user>:<ftp_password> ftp://<ftp_host>/`date '+%Y-%m-%d_%H-%M'`/db_backup.sql.gz --ftp-create-dirs -T - | |
# if you want to execute it through cron, be sure to escape all %! | |
# for crontab: | |
pg_dump <db_name> -U <db_user> -h <db_host> | gzip | curl -u <ftp_user>:<ftp_password> ftp://<ftp_host>/`date '+\%Y-\%m-\%d_\%H-\%M'`/db_backup.sql.gz --ftp-create-dirs -T - |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment