Automated Archives

Hi,

I am sure this is pretty straightforward, but I probably just don’t know enough :smile:

I see that I can automatically set up archives to be created from a server. Can I add to the automation? I would like to copy the archive over to my NAS, so I can back up the worlds. Also, can the timing be changed for archiving? I don’t think I need to back more than once a day (if not once a week). Alternatively, I could also go for automating keeping only the 5 most recent archives.

Any ideas are greatly appreciated!

Thanks,

Gil

The automation in the webui is limited to the most common actions at a few set intervals. Going beyond this then simply requires use of the mineos_console.py script you have in /usr/games/minecraft.

There are so many possibilities and arrangements that an admin might want over their server and where their files go, etc., so it is not plausible for me to anticipate those and make a webui that includes all of them (and remain simple, for those who don’t use it), so mineos_console.py helps bridge the gap between full control and a usable webui.

cd /usr/games/minecraft
./mineos_console.py -s myserver start
./mineos_console.py -s myserver stop
./mineos_console.py -s myserver archive
./mineos_console.py -s myserver backup

…you get the idea. That addresses how you can change the timing for any of the commands.

Every function in mineos.py (that starts with a letter) is a candidate to be scripted in this way. What you’re trying to do with moving files over to your NAS is basically a normal bash script involving cp or rsync.

Create a bash script that moves files from /var/games/minecraft/ and test to see if it works. That’s half the battle and shouldn’t require any real knowledge of MineOS other than where the files get saved. If you find that it works, then you just need to learn about crontabs, which is a utility that allows you to granularly schedule scripts to be run.

Combine a bash script that makes archives on your schedule, along with the functionality to rsync it on over to your NAS and throw in some crontabs and you’re set.

Keeping a rotating 5 archives, however, would require a different script (or at least different commands in the same script). Here is a link to some approaches used for rotating files; use at your own discretion!