#Settings
WORLDS[1]='World'
WORLDS[2]='World_2'
WORLDS[3]='World 3'
WORLDS[4]='World 4'
mc_backup() {
mc_saveoff
for i in "${WORLDS
echo $i; done
NOW=`date "+%Y-%m-%d_%Hh%M"`
BACKUP_FILE="$BACKUPPATH/${i}_${NOW}.tar"
echo "Backing up world: $i..."
#as_user "cd $MCPATH && cp -r $i $BACKUPPATH/${i}_`date "+%Y.%m.%d_%H.%M"`"
as_user "tar -C \"$MCPATH\" -cf \"$BACKUP_FILE\" $i"
echo "Backing up $SERVICE"
as_user "tar -C \"$MCPATH\" -rf \"$BACKUP_FILE\" $SERVICE"
#as_user "cp \"$MCPATH/$SERVICE\" \"$BACKUPPATH/OPS_server_${NOW}.jar\""
mc_saveon
echo "Compressing backup..."
as_user "gzip -f \"$BACKUP_FILE\""
echo "Done."