Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

optionally delete old backups #188

Merged
merged 6 commits into from
Jan 29, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
5 changes: 5 additions & 0 deletions scripts/backup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
sugoidogo marked this conversation as resolved.
Show resolved Hide resolved
find /palworld/backups/ -mindepth 1 -maxdepth 1 -mtime +$OLD_BACKUP_DAYS -print -delete
fi
Loading