Skip to content
Browse files

World backup fixed by jbondhus

Empty folders are no longer created each day. See issue 64 for more
info.
  • Loading branch information...
1 parent 0e48cb8 commit f4051a94653dce93fc5d9113419e607c9f01b6d5 @Ahtenus committed
Showing with 8 additions and 4 deletions.
  1. +8 −4 minecraft
View
12 minecraft
@@ -206,16 +206,17 @@ mc_world_backup() {
for INDEX in ${!WORLDNAME[@]}
do
echo "Backing up minecraft ${WORLDNAME[$INDEX]}"
- as_user "mkdir -p $BACKUPPATH/${today}"

Changed the today folder to only be made if compatibility with the backup rolling script is disabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
-
case "$BACKUPFORMAT" in
tar)
if [ "$BACKUPSCRIPTCOMPATIBLE" ]
- # If isset tars will be put in $BACKUPPATH without any timestamp to be compatible with
- # [backup rotation script](https://github.com/adamfeuer/rotate-backups)
+ # If is set tars will be put in $BACKUPPATH without any timestamp to be compatible with
+ # [backup rotation script](https://github.com/adamfeuer/rotate-backups)
then
+ echo "Deleting old backup of ${WORLDNAME[$INDEX]}"

Warns the user that it is deleting the obsolete backup of the world that is about to be backed up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
+ as_user "rm -r $BACKUPPATH/${WORLDNAME[$INDEX]}.zip"

Deletes the old backup of the world so that it can properly write a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
path=$BACKUPPATH/${WORLDNAME[$INDEX]}.tar.bz2
else
+ as_user "mkdir -p $BACKUPPATH/${today}"
path=`datepath $BACKUPPATH/${today}/${WORLDNAME[$INDEX]}_ .tar.bz2 .tar.bz2`
fi
as_user "tar -hcjf $path $MCPATH/${WORLDNAME[$INDEX]}"
@@ -223,8 +224,11 @@ mc_world_backup() {
zip)
if [ "$BACKUPSCRIPTCOMPATIBLE" ]
then
+ echo "Deleting old backup of ${WORLDNAME[$INDEX]}"
+ as_user "rm -r $BACKUPPATH/${WORLDNAME[$INDEX]}.zip"
path=$BACKUPPATH/${WORLDNAME[$INDEX]}.zip
else
+ as_user "mkdir -p $BACKUPPATH/${today}"
path=`datepath $BACKUPPATH/${today}/${WORLDNAME[$INDEX]}_ .zip .zip`
fi
as_user "zip -rq $path $MCPATH/${WORLDNAME[$INDEX]}"

0 comments on commit f4051a9

Please sign in to comment.
Something went wrong with that request. Please try again.