-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2fae24b
commit e7f1ef6
Showing
4 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
[Unit] | ||
Description=Dumps immich postgre database for backup | ||
Documentation=https://immich.app/docs/administration/backup-and-restore/ | ||
After=immich-database | ||
Requires=immich-database | ||
|
||
[Service] | ||
Type=oneshot | ||
# Dump the database as SQL | ||
ExecStart=podman exec -t immich_postgres pg_dumpall --clean --if-exists --username=postgres -f /var/db_backup/backup | ||
# Rename the file (double % to escape systemd specifiers) | ||
ExecStart=bash -c "mv /path/to/database_backup/backup /var/hdd-raid/immich/database_backup/$(date +%%Y%%m%%d)" | ||
# Compress the file (double % to escape systemd specifiers) | ||
ExecStart=bash -c "gzip /var/hdd-raid/immich/database_backup/$(date +%%Y%%m%%d)" | ||
RemainAfterExit=true | ||
|
||
[Install] | ||
WantedBy=multi-user.target |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[Unit] | ||
Description=Trigger immich-database-backup service | ||
|
||
[Timer] | ||
# Twice a week : mondays, thursdays, mornings | ||
OnCalendar=Mon,Thu 05:00 Europe/Paris | ||
|
||
[Install] | ||
WantedBy=timers.target |
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