New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
Is this possible with rsync?
Hi guys,
I have a Minecraft server. I want to backup the players' inventories (which are in /home/minecraft/world/players/) every 15 minutes by tarring them up and rsyncing them to my Hostigation backup VPS. I do not want to keep incremental backups, I want timestamped backups, every 15 minutes. How would I do this? My OS is CentOS 6.2 x64 and the Backup VPS has got Debian 5/6 on it, it's the backup template Hostigation supplies.
Regards,
Bird
Comments
Keep in mind Minecraft only saves inventories when the player disconnects and I think when save-all is run.
@dmmcintyre3 My server executes save-all every 5 minutes, and backups the world every 15 minutes. Should be okay
snipped.
didn't pay attention to the rsync part
could work, i'm going to test something like this now.
You make backups in a directory, you rsync the directory between the two vps servers and you delete files older than 30 days for example. That's a good way.
@OneTwo that's also good! I did not think of this earlier. Going to try both solutions. Need more thoughts to be sure though
If you can't achieve it I could probably write a script for you. Keep in mind you should learn about ssh keys firstly for auto backups.
@OneTwo I currently use this script to rsync my minecraft directory without worlds and map tiles to my backup VPS. It's really useful. https://github.com/brettalton/rsync-over-ssh/
@birdie25 you don't need to use rsync, you are not looking for incremental backups, so just write a script to tar + gzip the folder and use as the filename something-timestamp.tgz; then scp that over.
something like:
#!/bin/bash tar cvfz /backup/backup-
date +"%m-%d-%y".tar.gz /home/minecraft/world/players/ /usr/bin/find /backup/ -maxdepth 1 -type d -mtime +3 -exec rm -rf {} \;
there's back quotes around the "date +"%m-%d-%y"" part.
Maybe something like this?
This will make a new folder for each backup, with a name like, for example,
120207150059
, which in this example, would mean 2012 February 7th 15:00:59To run that every 15 minutes, simply add a cron
*/15 * * * * $command
where $command is either the above command, or a path to a sh script containing it.Edit: This is to be run on the backup server, of course
I've used http://www.cis.upenn.edu/~bcpierce/unison/
I think you are correct, unless I am missing something.