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_OPTIONS
pg_dump optionsPOSTGRESQL_HOST
the postgresql host requiredPOSTGRESQL_PORT
the postgresql port (default: 5432)POSTGRESQL_USER
the postgresql user requiredPOSTGRESQL_PASSWORD
the postgresql password requiredDROPBOX_PREFIX
path prefix in your Dropbox (default: empty)DROPBOX_ACCESS_TOKEN
your Dropbox API access token requiredSCHEDULE
backup schedule time, see explainatons belowDATABASE_NAME
the 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: