@@ -84,6 +84,8 @@ Options:
84
84
-d, --description <desc> snapper description
85
85
-h, --help print this message
86
86
-n, --noconfirm do not ask for confirmation
87
+ -k, --keepold keep old incremental snapshots instead of deleting them
88
+ after backup is performed
87
89
-p, --port <port> remote port; wsed with '--remote'.
88
90
-q, --quiet do not send notifications; instead print them.
89
91
-r, --remote <address> ip address of a remote machine to backup to
@@ -116,6 +118,10 @@ while [[ $# -gt 0 ]]; do
116
118
subvolid_cmdline=" $2 "
117
119
shift 2
118
120
;;
121
+ -k|--keepold)
122
+ keep=" yes"
123
+ shift
124
+ ;;
119
125
-n|--noconfirm)
120
126
noconfirm=" yes"
121
127
shift
@@ -464,8 +470,15 @@ for x in $selected_configs; do
464
470
# location where it can get its data. This helps speed up the transfer.
465
471
466
472
btrfs send -c " $old_snap " " $new_snap " | $ssh btrfs receive " $backup_location "
467
- printf " Modifying data for old local snapshot for '%s' configuration...\n" " $x " | tee $PIPE
468
- snapper -v -c " $x " modify -d " old snap-sync snapshot (you may remove)" -u " backupdir=,subvolid=,uuid=" -c " number" " $old_num "
473
+
474
+ if [[ $keep == " yes" ]]; then
475
+ printf " Modifying data for old local snapshot for '%s' configuration...\n" " $x " | tee $PIPE
476
+ snapper -v -c " $x " modify -d " old snap-sync snapshot (you may remove)" -u " backupdir=,subvolid=,uuid=" -c " number" " $old_num "
477
+ else
478
+ printf " Deleting old snapshot for %s...\n" " $x " | tee $PIPE
479
+ snapper -c " $x " delete " $old_num "
480
+ fi
481
+
469
482
fi
470
483
471
484
if [[ -z $remote ]]; then
0 commit comments