I have set up a backup script to back up world data on my Minecraft server hourly using cron, but because the worlds being constantly edited by players, tar was telling me that files changed while they were read. I added --ignore-command-error to the tar in the script and that suppresses any errors when I run it manually, however cron still sends a mail message saying that files were changed while being read, and ends up flooding my mail because it's run once an hour. Anyone know how to fix this? This is the script:
filename=$(date +%Y-%m-%d)
cd /home/minecraft/Server/
for world in survival survival_nether survival_the_end creative superflat
do
if [ ! -d "/home/minecraft/backups/$world" ]; then
mkdir /home/minecraft/backups/$world
fi
find /home/minecraft/backups/$world -mtime +1 -delete
tar --ignore-command-error -c $world/ | nice -n 10 pigz -9 > /home/minecraft/backups/$world/$filename.tar.gz
done