2 changed files with 24 additions and 0 deletions
@ -0,0 +1,14 @@ |
|||
[Unit] |
|||
Description=Load/Dump database on start/stop |
|||
After=postgresql.service |
|||
Requires=postgresql.service |
|||
|
|||
[Service] |
|||
Type=oneshot |
|||
RemainAfterExit=yes |
|||
EnvironmentFile=/etc/environment |
|||
ExecStart=/bin/bash -c "db-load /vol/data/sql/$DBNAME-updown.sql" |
|||
ExecStop=/bin/bash -c "db-dump /vol/data/sql/$DBNAME-updown.sql" |
|||
|
|||
[Install] |
|||
WantedBy=multi-user.target |
Loading…
Reference in new issue