Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Is this possible with rsync?
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.

Is this possible with rsync?

birdie25birdie25 Member
edited February 2012 in Help

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 ;)

  • u4iau4ia Member
    edited February 2012

    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 :D

  • 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.

  • qenoxqenox Member
    edited February 2012

    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 {} \;

    Thanked by 1Asim
  • there's back quotes around the "date +"%m-%d-%y"" part.

  • KuroKuro Member
    edited February 2012

    Maybe something like this?

    /usr/bin/rsync -av -e "ssh -i /home/rsyncuser/.ssh/id_rsa" [email protected]:/home/minecraft/world/players /path/to/where/you/want/the/backups/$(/bin/date +%y%m%d%H%M%S)

    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:59 :)

    To 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 ;)

  • @dmmcintyre3 said: Keep in mind Minecraft only saves inventories when the player disconnects and I think when save-all is run.

    I think you are correct, unless I am missing something.

Sign In or Register to comment.