Daily Postgresql Backup by systemd
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
[Unit] | |
Description=Daily PG Backup | |
Documentation=man:pg_dump(8) | |
ConditionACPower=true | |
After=postgresql.service network.target network-online.target systemd-networkd.service NetworkManager.service connman.service | |
[Service] | |
Type=oneshot | |
User=postgres | |
Group=postgres | |
ExecStart=/usr/bin/pg_dump --dbname=app_db --format=c --jobs=1 --compress=3 --verbose --create --file=/var/backups/postgresql/app_db.sql | |
KillMode=process | |
TimeoutStopSec=900 |
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
[Unit] | |
Description=Daily PG Backup | |
After=database-daily-backup.timer | |
[Timer] | |
OnCalendar=*-*-* 02:00 | |
RandomizedDelaySec=10m | |
Persistent=true | |
[Install] | |
WantedBy=timers.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment