Initial commit

master
Inex Code 4 years ago
commit dc1ce6ddb4

@ -0,0 +1,14 @@
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. You just DO WHAT THE FUCK YOU WANT TO.

@ -0,0 +1,5 @@
RETENTION_DAYS=7
RETENTION_WEEKS=4
RETENTION_MONTHS=6
RETENTION_YEARS=3
RESTIC_PASSWORD=

@ -0,0 +1,5 @@
RETENTION_DAYS=7
RETENTION_WEEKS=4
RETENTION_MONTHS=6
RETENTION_YEARS=3
RESTIC_PASSWORD=

@ -0,0 +1,9 @@
[Unit]
Description=Mastodon database backup service
[Service]
User=mastodon
Group=restic
Type=oneshot
ExecStart=/bin/bash /home/mastodon/backup.sh
ExecStartPost=/usr/bin/restic forget -r /backups/mastodon/database --tag systemd.timer --group-by "paths,tags" --keep-daily $RETENTION_DAYS --keep-weekly $RETENTION_WEEKS --keep-monthly $RETENTION_MONTHS --keep-yearly $RETENTION_YEARS
EnvironmentFile=/home/mastodon/.config/mastodon-database-backup.conf

@ -0,0 +1,7 @@
[Unit]
Description=Backup mastodon database with restic daily
[Timer]
OnCalendar=daily
Persistent=true
[Install]
WantedBy=multi-user.target

@ -0,0 +1,8 @@
[Unit]
Description=Mastodon database backup service (data pruning)
[Service]
User=mastodon
Group=restic
Type=oneshot
ExecStart=/usr/bin/restic -r /backups/mastodon/database prune
EnvironmentFile=/home/mastodon/.config/mastodon-database-backup.conf

@ -0,0 +1,7 @@
[Unit]
Description=Prune data from the restic repository monthly (Mastodon db)
[Timer]
OnCalendar=weekly
Persistent=true
[Install]
WantedBy=multi-user.target

@ -0,0 +1 @@
pg_dump -Fc pixelfed -f /home/pixelfed/database.bak && restic backup -r /backups/pixelfed/database --tag systemd.timer.database /home/pixelfed/database.bak && rm /home/pixelfed/database.bak && restic backup -r /backups/pixelfed/database --tag systemd.timer.media /home/pixelfed/pixelfed/storage/app/public

@ -0,0 +1,5 @@
RETENTION_DAYS=7
RETENTION_WEEKS=4
RETENTION_MONTHS=6
RETENTION_YEARS=3
RESTIC_PASSWORD=

@ -0,0 +1,9 @@
[Unit]
Description=Pixelfed data backup service
[Service]
User=pixelfed
Group=restic
Type=oneshot
ExecStart=/bin/bash /home/pixelfed/backup.sh
ExecStartPost=/usr/bin/restic forget -r /backups/pixelfed/database --group-by "paths,tags" --keep-daily $RETENTION_DAYS --keep-weekly $RETENTION_WEEKS --keep-monthly $RETENTION_MONTHS --keep-yearly $RETENTION_YEARS
EnvironmentFile=/home/pixelfed/.config/pixelfed-backup.conf

@ -0,0 +1,7 @@
[Unit]
Description=Backup pixelfed with restic daily
[Timer]
OnCalendar=daily
Persistent=true
[Install]
WantedBy=multi-user.target

@ -0,0 +1,8 @@
[Unit]
Description=Pixelfed data backup service (data pruning)
[Service]
User=pixelfed
Group=restic
Type=oneshot
ExecStart=/usr/bin/restic -r /backups/pixelfed/database prune
EnvironmentFile=/home/pixelfed/.config/pixelfed-backup.conf

@ -0,0 +1,7 @@
[Unit]
Description=Prune data from the restic repository monthly (pixelfed)
[Timer]
OnCalendar=weekly
Persistent=true
[Install]
WantedBy=multi-user.target

@ -0,0 +1 @@
# Backup services of my servers
Loading…
Cancel
Save