reintroduce separate pruning
This commit is contained in:
@@ -6,3 +6,6 @@ export RESTIC_PASSWORD="${RESTIC_PASSWORD}"
|
|||||||
info "Starting backup"
|
info "Starting backup"
|
||||||
restic -r $RESTIC_REPOSITORY unlock
|
restic -r $RESTIC_REPOSITORY unlock
|
||||||
restic --cache-dir $CACHE_DIR -r $RESTIC_REPOSITORY backup $BACKUP_PATHS $BACKUP_EXCLUDES
|
restic --cache-dir $CACHE_DIR -r $RESTIC_REPOSITORY backup $BACKUP_PATHS $BACKUP_EXCLUDES
|
||||||
|
|
||||||
|
info "Forgetting snapshots"
|
||||||
|
restic --cache-dir $CACHE_DIR -r $RESTIC_REPOSITORY forget --keep-hourly $KEEP_HOURS --keep-daily $KEEP_DAYS --keep-weekly $KEEP_WEEKS --keep-monthly $KEEP_WEEKS --keep-yearly $KEEP_YEARS
|
||||||
@@ -40,7 +40,7 @@ ping -c 3 192.168.178.100 &> /dev/null
|
|||||||
|
|
||||||
if [[ $? > 0 ]]; then
|
if [[ $? > 0 ]]; then
|
||||||
|
|
||||||
ping -c 3 1.1.1.1 &> /dev/null
|
ping -c 3 10.0.1.3 &> /dev/null
|
||||||
|
|
||||||
if [[ $? > 0 ]]; then
|
if [[ $? > 0 ]]; then
|
||||||
info "Not connected."
|
info "Not connected."
|
||||||
@@ -51,4 +51,4 @@ fi
|
|||||||
BACKUP_SERVER="192.168.178.100"
|
BACKUP_SERVER="192.168.178.100"
|
||||||
echo "Done"
|
echo "Done"
|
||||||
|
|
||||||
read_config
|
read_config
|
||||||
@@ -2,10 +2,5 @@
|
|||||||
|
|
||||||
source $HOME/.bin/restic_common
|
source $HOME/.bin/restic_common
|
||||||
|
|
||||||
info "Forgetting snapshots"
|
|
||||||
restic -r $RESTIC_REPOSITORY unlock
|
|
||||||
restic --cache-dir $CACHE_DIR -r $RESTIC_REPOSITORY forget --keep-hourly $KEEP_HOURS --keep-daily $KEEP_DAYS --keep-weekly $KEEP_WEEKS --keep-monthly $KEEP_WEEKS --keep-yearly $KEEP_YEARS
|
|
||||||
|
|
||||||
info "Pruning snapshots"
|
info "Pruning snapshots"
|
||||||
restic -r $RESTIC_REPOSITORY unlock
|
restic --cache-dir $CACHE_DIR -r $RESTIC_REPOSITORY prune
|
||||||
restic --cache-dir $CACHE_DIR -r $RESTIC_REPOSITORY prune
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=borg backup
|
Description=restic backup
|
||||||
Before=restic-prune.service
|
Before=restic-prune.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
@@ -7,4 +7,4 @@ Type=oneshot
|
|||||||
ExecStart=%h/.bin/restic_backup
|
ExecStart=%h/.bin/restic_backup
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=prune borg snapshots
|
Description=restic prune snapshots
|
||||||
After=restic-backup.service
|
After=restic-backup.service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
@@ -7,4 +7,4 @@ Type=oneshot
|
|||||||
ExecStart=%h/.bin/restic_prune
|
ExecStart=%h/.bin/restic_prune
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=multi-user.target
|
WantedBy=multi-user.target
|
||||||
@@ -1,10 +1,10 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
Description=prune restic snapshots
|
Description=restic prune snapshots
|
||||||
|
|
||||||
[Timer]
|
[Timer]
|
||||||
Persistent=true
|
Persistent=true
|
||||||
OnCalendar=daily
|
OnCalendar=weekly
|
||||||
Unit=restic-prune.service
|
Unit=restic-prune.service
|
||||||
|
|
||||||
[Install]
|
[Install]
|
||||||
WantedBy=timers.target
|
WantedBy=timers.target
|
||||||
Reference in New Issue
Block a user