Backup PostgreSQL to Dropbox (supports periodic backups & multi files)
$ docker run \
--name postgresql_backup \
-d \
--restart=always \
--log-opt max-size=1m \
--log-opt max-file=5 \
-e POSTGRESQL_USER=root \
-e POSTGRESQL_PASSWORD=root \
-e POSTGRESQL_HOST=localhost \
-e DROPBOX_ACCESS_TOKEN=YOUR_TOKEN \
-e SCHEDULE=@daily \
-e DATABASE_NAME=databasename
diogoarm/postgresql-backup-dropbox
POSTGRESQLDUMP_OPTIONSpg_dump optionsPOSTGRESQL_HOSTthe postgresql host requiredPOSTGRESQL_PORTthe postgresql port (default: 5432)POSTGRESQL_USERthe postgresql user requiredPOSTGRESQL_PASSWORDthe postgresql password requiredDROPBOX_PREFIXpath prefix in your Dropbox (default: empty)DROPBOX_ACCESS_TOKENyour Dropbox API access token requiredSCHEDULEbackup schedule time, see explainatons belowDATABASE_NAMEthe postgresql databasename required
You can additionally set the SCHEDULE environment variable like -e SCHEDULE="@daily" to run the backup automatically.
More information about the scheduling can be found here.
Visit the Dropbox app creation page, and fill following fields in there.
- Choose an API ... Dropbox API
- Choose the type of access you need ... App folder
- Name your app ... Your favorite name. This will be a folder name.
Once an application have created, you should press "Generate" button to generate your access token:

