From a467afafbfb6c64aef5f22faa04a5d772d1a34d7 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 0ada91e61e4c81ec0d3e9047001f14c2c810eacb 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 612f679109a6531a84af8f63cdd39f423ce71cd6 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 bb2f49dd0d450b493d22782e3ce06aff36afccfd 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 044bb681a4fa35dd638989c1dba28c22da0b9ec5 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 73420e94c9848f272a8192475cb48b437495ba54 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