From fdd80620cc033a88858bfdf119aabb67f13a85c4 Mon Sep 17 00:00:00 2001 From: SugoiDogo Date: Sun, 28 Jan 2024 10:45:11 -0800 Subject: [PATCH 1/6] optionally delete old backups --- scripts/backup.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/backup.sh b/scripts/backup.sh index 43eecb460..726f698cb 100644 --- a/scripts/backup.sh +++ b/scripts/backup.sh @@ -15,3 +15,8 @@ if [ "$(id -u)" -eq 0 ]; then fi echo "backup created at $FILE_PATH" + +if [ "${DELETE_OLD_BACKUPS}" = true ]; then + echo "removing backups older than $OLD_BACKUP_DAYS days" + find /palworld/backups/ -mindepth 1 -maxdepth 1 -mtime +$OLD_BACKUP_DAYS -print -delete +fi From 16d7bd9e7d27fd9f1c6bf1e66c39c2f56bbefc6b Mon Sep 17 00:00:00 2001 From: SugoiDogo Date: Sun, 28 Jan 2024 11:20:53 -0800 Subject: [PATCH 2/6] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 1999ded29..517870431 100644 --- a/README.md +++ b/README.md @@ -136,6 +136,8 @@ It is highly recommended you set the following environment values before startin | RCON_ENABLED*** | Enable RCON for the Palworld server | true | true/false | | RCON_PORT | RCON port to connect to | 25575 | 1024-65535 | | QUERY_PORT | Query port used to communicate with Steam servers | 27015 | 1024-65535 | +| DELETE_OLD_BACKUPS | Delete backups after a certain number of days | false | true/false | +| OLD_BACKUP_DAYS | How many days to keep backups | | any positive integer | *highly recommended to set From b3fe76bb4d49a7c7d4023c6822202b5268db16f6 Mon Sep 17 00:00:00 2001 From: SugoiDogo Date: Mon, 29 Jan 2024 06:50:25 -0800 Subject: [PATCH 3/6] include default backup retention time --- scripts/backup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/backup.sh b/scripts/backup.sh index 726f698cb..0695abf45 100644 --- a/scripts/backup.sh +++ b/scripts/backup.sh @@ -17,6 +17,6 @@ fi echo "backup created at $FILE_PATH" if [ "${DELETE_OLD_BACKUPS}" = true ]; then - echo "removing backups older than $OLD_BACKUP_DAYS days" + echo "removing backups older than ${OLD_BACKUP_DAYS:=30} days" find /palworld/backups/ -mindepth 1 -maxdepth 1 -mtime +$OLD_BACKUP_DAYS -print -delete fi From 92378907072bd447c3a28588c0f6b68b9ece8f93 Mon Sep 17 00:00:00 2001 From: SugoiDogo Date: Mon, 29 Jan 2024 06:50:52 -0800 Subject: [PATCH 4/6] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 517870431..7aba63389 100644 --- a/README.md +++ b/README.md @@ -137,7 +137,7 @@ It is highly recommended you set the following environment values before startin | RCON_PORT | RCON port to connect to | 25575 | 1024-65535 | | QUERY_PORT | Query port used to communicate with Steam servers | 27015 | 1024-65535 | | DELETE_OLD_BACKUPS | Delete backups after a certain number of days | false | true/false | -| OLD_BACKUP_DAYS | How many days to keep backups | | any positive integer | +| OLD_BACKUP_DAYS | How many days to keep backups | 30 | any positive integer | *highly recommended to set From ded6a27d01fef0d5e28116bdc551f738e5055e80 Mon Sep 17 00:00:00 2001 From: SugoiDogo Date: Mon, 29 Jan 2024 07:30:37 -0800 Subject: [PATCH 5/6] resolve linter error SC2086 https://github.com/thijsvanloef/palworld-server-docker/actions/runs/7687902534/job/20962774094 --- scripts/backup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/backup.sh b/scripts/backup.sh index 0695abf45..928e96bd8 100644 --- a/scripts/backup.sh +++ b/scripts/backup.sh @@ -18,5 +18,5 @@ echo "backup created at $FILE_PATH" if [ "${DELETE_OLD_BACKUPS}" = true ]; then echo "removing backups older than ${OLD_BACKUP_DAYS:=30} days" - find /palworld/backups/ -mindepth 1 -maxdepth 1 -mtime +$OLD_BACKUP_DAYS -print -delete + find /palworld/backups/ -mindepth 1 -maxdepth 1 -mtime "+$OLD_BACKUP_DAYS" -print -delete fi From 7968c6d76d319bf83e1f0204d44944611dddbc80 Mon Sep 17 00:00:00 2001 From: Thijs van Loef Date: Mon, 29 Jan 2024 17:55:28 +0100 Subject: [PATCH 6/6] add {} around variable --- scripts/backup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/backup.sh b/scripts/backup.sh index 928e96bd8..707df6ce0 100644 --- a/scripts/backup.sh +++ b/scripts/backup.sh @@ -18,5 +18,5 @@ echo "backup created at $FILE_PATH" if [ "${DELETE_OLD_BACKUPS}" = true ]; then echo "removing backups older than ${OLD_BACKUP_DAYS:=30} days" - find /palworld/backups/ -mindepth 1 -maxdepth 1 -mtime "+$OLD_BACKUP_DAYS" -print -delete + find /palworld/backups/ -mindepth 1 -maxdepth 1 -mtime "+${OLD_BACKUP_DAYS}" -print -delete fi