Just load this job into your cron with crontab x (x is the name of your saved file). It's something I made in a few minutes to backup the server_level.dat every hour for 24 hours, then overwrite the old one. The filename of the backup corresponds with the time made (backup0 is at 12AM, backup1 at 1AM, backup 23 at 11PM, etc). Enjoy. Also, don't forget to change your paths to correspond to the path to your Minecraft server directory, and the backup directory which you have to make prior. Check whether this script is loaded with crontab -l (it should mirror what is in the file), and do a ps -ef | grep [c]ron to make sure cron is running (that command should return some sort of output).
And yes, I know you can do this in a few lines of Python also, however, this took me a lot less time and effort, and it does exactly what I need. If you want to archive not backup in case of griefers, this is the tool for you. If you're on Windows or don't know what the command line is, it's not.
Edit - Oh yes, I almost forgeo. The output of the cron commands is logged in /tmp/backup.log, and if there are going to be errors with your command (wrong path, etc), they will show up there.
It looks like your one line will only keep a backup of the past hour, overwriting the same file (unless I'm mistaken). He wants a record of backups from the past 24 hours because more than likely you will not find your server griefed within one hour of it happening.
Rollback Post to RevisionRollBack
MineCraft Server Operator v0.3b
Votekick/voteban, remote access, automated backups, cross-platform and more.
Control your server.
It looks like your one line will only keep a backup of the past hour, overwriting the same file (unless I'm mistaken). He wants a record of backups from the past 24 hours because more than likely you will not find your server griefed within one hour of it happening.
It looks like your one line will only keep a backup of the past hour, overwriting the same file (unless I'm mistaken). He wants a record of backups from the past 24 hours because more than likely you will not find your server griefed within one hour of it happening.
Would this overwrite files older than 24 hours? Like I said, the one I wrote was just specifically for me (the box I'm running this off of has a pretty filled HD, and I can't afford too many backups. Couple that with the fact that I need to go on a 3 week trip in August, and I want it to be as automatic as it can be).
Would this overwrite files older than 24 hours? Like I said, the one I wrote was just specifically for me (the box I'm running this off of has a pretty filled HD, and I can't afford too many backups. Couple that with the fact that I need to go on a 3 week trip in August, and I want it to be as automatic as it can be).
Download here
And yes, I know you can do this in a few lines of Python also, however, this took me a lot less time and effort, and it does exactly what I need. If you want to archive not backup in case of griefers, this is the tool for you. If you're on Windows or don't know what the command line is, it's not.
Edit - Oh yes, I almost forgeo. The output of the cron commands is logged in /tmp/backup.log, and if there are going to be errors with your command (wrong path, etc), they will show up there.
Votekick/voteban, remote access, automated backups, cross-platform and more.
Control your server.
Adjusted for your observation:
That'd look something like this:
Of course, adjust the datestamp to taste.
Would this overwrite files older than 24 hours? Like I said, the one I wrote was just specifically for me (the box I'm running this off of has a pretty filled HD, and I can't afford too many backups. Couple that with the fact that I need to go on a 3 week trip in August, and I want it to be as automatic as it can be).
maybe?
Actually, a shell script is needed. Don't forget to chmod it so it's executable.
Yes, it does only keep the last 24 hours worth of backups.
Use the shell script above (save it as a .sh). Then chmod +x script.sh. In cron, you can now do this (load into a crontab)...
Have fun. (errors will be logged in /tmp/backup.log)
Should be:
type: crontab -e
add:
Save.
Not if you escaped "%" (add \) within the cronfile.