From 8633b335ae79757f478dcb8ce99797b9d4683f28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pascal=20K=C3=B6nig?= Date: Fri, 21 Sep 2012 02:14:17 +0200 Subject: [PATCH] Added an option to the config to turn whole-backup-compression on and off --- config.example | 10 ++++++++++ minecraft | 8 +++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/config.example b/config.example index 14aa4c0..f7143e5 100644 --- a/config.example +++ b/config.example @@ -65,6 +65,16 @@ LOGPATH="/home/${USERNAME}/mcbackup/logs" # whole-backup is a complete uncompressed backup of the whole server folder. WHOLEBACKUP="/home/${USERNAME}/mcbackup/server" +# Compress the whole backup with bzip2? +# Note that this may not save a lot of disk space since there can be a lot of files +# in your server directory, that are already compressed, but it can slow down the +# backup a bit. This highly depends on the plugins you're using. +# +# For example: The png files generated by Dynmap are already compressed and still use +# a lot of space in your server directory, so the compression ratio of the compressed +# backup will not be very high. +COMPRESS_WHOLEBACKUP=YES + # Where the worlds are located on the disk. Can not be the same as MCPATH. # You need to move your worlds to this directory manually, the script # will then handle the nessessay symlinks. diff --git a/minecraft b/minecraft index d0d668e..6887abe 100755 --- a/minecraft +++ b/minecraft @@ -203,7 +203,13 @@ mc_whole_backup() { echo "backing up entire setup into $WHOLEBACKUP" path=`datepath $WHOLEBACKUP/mine_` as_user "mkdir -p $path" - as_user "tar -cpf $path/whole-backup.tar $MCPATH" + + if [ "$COMPRESS_WHOLEBACKUP" ] + then + as_user "tar -cpjf $path/whole-backup.tar.bz2 $MCPATH" + else + as_user "tar -cpf $path/whole-backup.tar $MCPATH" + fi } mc_world_backup() { #