-
Notifications
You must be signed in to change notification settings - Fork 125
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Empty folders are no longer created each day. See issue 64 for more info.
- Loading branch information
Showing
1 changed file
with
8 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -206,25 +206,29 @@ mc_world_backup() { | |
for INDEX in ${!WORLDNAME[@]} | ||
do | ||
echo "Backing up minecraft ${WORLDNAME[$INDEX]}" | ||
as_user "mkdir -p $BACKUPPATH/${today}" | ||
This comment has been minimized.
Sorry, something went wrong. |
||
|
||
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]}" | ||
This comment has been minimized.
Sorry, something went wrong.
jbondhus
Contributor
|
||
as_user "rm -r $BACKUPPATH/${WORLDNAME[$INDEX]}.zip" | ||
This comment has been minimized.
Sorry, something went wrong.
jbondhus
Contributor
|
||
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]}" | ||
;; | ||
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]}" | ||
|
Changed the today folder to only be made if compatibility with the backup rolling script is disabled.