Hi there i am using a script which i found in the internet and have modified for my own needs:
I have problems with the are where the mv command is being used in the script.
After starting the script my first zip file "worldbakhour0.zip" is generated well and correct naming.
When i run this script the second time it should rename the "worldbakhour0.zip" into "worldbakhour6.zip". Instead it renames it as follows "worldbakhour6.zip?".
I can rename those files back again if i tab the name i get "worldbakhour0.zip^M". Also the files arent red as my other .zip archives, they are grey.
Can someone give me a hint how to fix the problem with my script ?
The cronjob is working well.
Code:
screen -R ftb -X stuff "say Backup starting. World no longer saving... $(printf '\r')"
screen -R ftb -X stuff "save-off $(printf '\r')"
screen -R ftb -X stuff "save-all $(printf '\r')"
sleep 3
cd ~
cd /McMyAdmin/Minecraft/bak
rm -f worldbakhour24.zip
mv -f worldbakhour18.zip worldbakhour24.zip
mv -f worldbakhour12.zip worldbakhour18.zip
mv -f worldbakhour6.zip worldbakhour12.zip
mv -f worldbakhour0.zip worldbakhour6.zip
zip -r /home/ftb/McMyAdmin/Minecraft/bak/worldbakhour0.zip /home/ftb/McMyAdmin/Minecraft/Overworld -x /home/ftb/McMyAdmin/Minecraft/Overworld/DIM-100/**\* /home/ftb/McMyAdmin/Minecraft/Overworld/DIM-19/**\* /home/ftb/McMyAdmin/Minecraft/Overworld/DIM-34/**\* /home/ftb/McMyAdmin/Minecraft/Overworld/DIM-37/**\* /home/ftb/McMyAdmin/Minecraft/Overworld/DIM-38/**\* /home/ftb/McMyAdmin/Minecraft/Overworld/DIM-42/**\* /home/ftb/McMyAdmin/Minecraft/Overworld/DIM-7/**\* /home/ftb/McMyAdmin/Minecraft/Overworld/DIM10/**\* /home/ftb/McMyAdmin/Minecraft/Overworld/DIM-37/**\* /home/ftb/McMyAdmin/Minecraft/Overworld/DIM2/**\* /home/ftb/McMyAdmin/Minecraft/Overworld/DIM8/**\* /home/ftb/McMyAdmin/Minecraft/Overworld/DIM_*/**\* /home/ftb/McMyAdmin/Minecraft/Overworld/Mine/**\*
screen -R ftb -X stuff "save-on $(printf '\r')"
screen -R ftb -X stuff "say Backup complete. World now saving. $(printf '\r')"
I have problems with the are where the mv command is being used in the script.
After starting the script my first zip file "worldbakhour0.zip" is generated well and correct naming.
When i run this script the second time it should rename the "worldbakhour0.zip" into "worldbakhour6.zip". Instead it renames it as follows "worldbakhour6.zip?".
I can rename those files back again if i tab the name i get "worldbakhour0.zip^M". Also the files arent red as my other .zip archives, they are grey.
Can someone give me a hint how to fix the problem with my script ?
The cronjob is working well.