added example-backup.sh
This commit is contained in:
15
example-backup.sh
Normal file
15
example-backup.sh
Normal file
@@ -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)
|
||||
Reference in New Issue
Block a user