Skip to content

Commit 4cbc423

Browse files
authored
Merge pull request #328 from zanix/backup-prune
Add clean-backups Command
2 parents d18feea + 9d3524e commit 4cbc423

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

msctl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,10 @@ Actions:
135135
backup <world1> <world2> <...>
136136
Backup the Minecraft world(s). Backup all worlds by default.
137137
138+
clean-backups <world>
139+
Remove expired backups for the world. Removes old backups based on
140+
mscs-backup-duration.
141+
138142
list-backups <world>
139143
List the datetime of the backups for the world.
140144
@@ -3290,6 +3294,19 @@ case "$COMMAND" in
32903294
done
32913295
printf ".\n"
32923296
;;
3297+
clean-backups)
3298+
if isWorldEnabled "$1"; then
3299+
worldBackupCleanup "$1"
3300+
elif [ -n "$1" ]; then
3301+
printf "World '$1' does not exist or not enabled.\n"
3302+
printf " Usage: $PROG $COMMAND <world>\n"
3303+
exit 1
3304+
else
3305+
printf "World not supplied.\n"
3306+
printf " Usage: $PROG $COMMAND <world>\n"
3307+
exit 1
3308+
fi
3309+
;;
32933310
list-backups)
32943311
if isWorldEnabled "$1"; then
32953312
worldBackupList "$1"

0 commit comments

Comments
 (0)