User blog comment:LOTRMod/Auto-Downloads/@comment-25612015-20150313001823

Hello Mevans,

I've been doing it for a while on my own server (It's a hARDA world).

On Unix servers, it's really easy to do.

In the system scheduler (cron), you just add this in the /etc/crontab config file to run the script every 10 minutes with an account named minecraft:

*/10    *       *       *       *       minecraft       /path/to/thescript

In the /path/to/thescript file, you write something like:

'''#!/bin/sh cd /home/minecraft cp world/LOTR.dat backups/LOTR.dat.`date "+.%u-%H-%M"` tar czf backups/playerdata/playerdata-`date "+.%u-%H-%M"`.tar.gz world/playerdata world/stats'''

assuming your Minecraft server is installed in "/home/minecraft" and that you previously made a subdir named "backups" to store these backup copies, which will be kept for 7 days.

The last line is to archive players characteristics, inventories and stats. It might be useful...

The only problem with this, is that sometimes the LOTR mod is locking or writing to the LOTR.dat file. In this case, the copy would result in a blank file, but if you have backups made every 10 minutes, it shouldn't be an issue. The contrary might be also true, when we make the backup copy, it is possible that the LOTR mod be prevented from writing into the file (never happened on my server with hourly backups, but there may be a race condition there).

Best regards,

PS: Thanks for this excellent mod!