Added db dump timer

This commit is contained in:
mrhanky
2017-08-22 20:27:52 +02:00
parent deb8c3b985
commit f8ffd95184
3 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,7 @@
[Unit]
Description=nxy database dump timer
[Service]
Type=oneshot
WorkingDirectory=/home/nxy/backups
ExecStart=/bin/sh -c "/usr/bin/pg_dump -d nxy_prod > $(date +%Y-%m-%d_%H-%M-%S).sql"

11
files/nxy-db-dump.timer Normal file
View File

@ -0,0 +1,11 @@
[Unit]
Description=nxy database dump timer
[Timer]
# Time to wait after booting before we run first time
OnBootSec=10min
# Time between running each consecutive time
OnUnitActiveSec=12h
[Install]
WantedBy=default.target