From fdd3ce9b5d360c524ee75ebfefd4b01bbb56b48a Mon Sep 17 00:00:00 2001 From: xnite Date: Mon, 13 Apr 2026 19:20:17 -0700 Subject: [PATCH] added example-backup.sh --- example-backup.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 example-backup.sh diff --git a/example-backup.sh b/example-backup.sh new file mode 100644 index 0000000..19800cc --- /dev/null +++ b/example-backup.sh @@ -0,0 +1,15 @@ +#!/bin/bash +# Best used in a cron job: +# crontab -e +# 00 01 * * * /path/to/backup.sh + +BASE_PATH=/path/to/simple-minecraft-server # Change this to the path which your docker-compose.yml is in. Remove the trailing /. +SOURCE=$BASE_PATH/data # If you are using the docker-compose.yml provided in this repo then all of the data that you will want to backup is stored in ./data +DESTINATION=$BASE_PATH/backups # set this to the location of where you want to back your minecraft server data up to. +KEEP_MAX_AGE=6D # this default will delete backups older than 6 days. + +########################### +# DO NOT EDIT THESE LINES # +########################### +rdiff-backup $SOURCE $DESTINATION/$(date +%A) +rdiff-backup --force --remove-older-than $KEEP_MAX_AGE $DESTINATION/$(date +%A) \ No newline at end of file