Skip to content

Instantly share code, notes, and snippets.

@jrx
Last active October 18, 2017 09:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jrx/28e57189bf932dc3d6554a9800c9bc05 to your computer and use it in GitHub Desktop.
Save jrx/28e57189bf932dc3d6554a9800c9bc05 to your computer and use it in GitHub Desktop.
{
"id": "pgdump",
"run": {
"cpus": 0.5,
"mem": 512,
"disk": 0,
"cmd": "pg_dump --dbname=$PGDB --host=$PGHOST --port=$PGPORT --username=$PGUSER > $BACKUP_FOLDER/$PGHOST-$PGDB-`date +\\%Y-\\%m-\\%d-\\%H-\\%M-\\%S`.sql && gzip $BACKUP_FOLDER/*",
"docker": {
"image": "postgres:9.6"
},
"env": {
"BACKUP_FOLDER": "/var/lib/pg_backup",
"PGPASSWORD": "password",
"PGUSER": "admin",
"PGHOST": "postgresql.marathon.l4lb.thisdcos.directory",
"PGPORT": "5432",
"PGDB": "defaultdb"
},
"volumes": [
{
"containerPath": "/var/lib/pg_backup",
"hostPath": "/var/lib/pg_backup",
"mode": "RW"
}
]
},
"schedules": [
{
"id": "default",
"enabled": true,
"cron": "0 3 * * *",
"concurrencyPolicy": "ALLOW"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment