Author Topic: Minecraft backup script.  (Read 3125 times)

0 Members and 1 Guest are viewing this topic.

Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Minecraft backup script.
« on: May 02, 2011, 05:48:52 pm »
Could someone help me with a script that would back up my Minecraft server every half hour?
(By help, I mostly mean doing it for me.)
It should have 24 backups (12 hours worth) and when that is done it overwrites the first backup.

Backup 1
Backup 2
....
Backup 24
Backup 1


I know a little C and i am fluent in Axe (not sure if the latter helps :P )



I have been in this community for quite some time, so even though this isn't a computer programing community, I know you guys won't give me viruses :/ )
« Last Edit: May 02, 2011, 07:50:03 pm by Happybobjr »
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________

Offline qazz42

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1130
  • Rating: +30/-12
  • hiiiiiiiii
    • View Profile
Re: Minecraft backup script.
« Reply #1 on: May 02, 2011, 06:25:36 pm »
well, you could make a .bat file that gets run every 30 mins that copyies your server to a backup folder. IDK how that would work (in regards to the every 30 mins thing)

Offline ruler501

  • Meep
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2475
  • Rating: +66/-9
  • Crazy Programmer
    • View Profile
Re: Minecraft backup script.
« Reply #2 on: May 02, 2011, 06:27:57 pm »
The every 30 min thing you could create in Windows easily(if admin), but I don't know how to do it in other OS's. It is just a scheduled task. I'm sure every OS can do it
I currently don't do much, but I am a developer for a game you should totally try out called AssaultCube Reloaded download here https://assaultcuber.codeplex.com/
-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCM/CS/M/S d- s++: a---- C++ UL++ P+ L++ E---- W++ N o? K- w-- o? !M V?
PS+ PE+ Y+ PGP++ t 5? X R tv-- b+++ DI+ D+ G++ e- h! !r y

Offline Silver Shadow

  • Beta Tester
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 817
  • Rating: +27/-7
    • View Profile
Re: Minecraft backup script.
« Reply #3 on: May 02, 2011, 06:32:01 pm »
Try checking out Bukkit and its plugins. I'm pretty sure you'll find something of that sort there.
Former Coder of Tomorrow


Offline Happybobjr

  • James Oldiges
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2325
  • Rating: +128/-20
  • Howdy :)
    • View Profile
Re: Minecraft backup script.
« Reply #4 on: May 02, 2011, 07:50:07 pm »
Kick me as hard as you can.  I was thinking of asking to be banned for wasting time with such a dumb question. (it may not be dumb to you as you may not have been exposed to such things)  I had to save as a bat file instead of txt :P

I found this.
How do i compile it?

:: CHANGE THESE VARIABLES TO SUIT YOUR NEEDS ::
set WORLD_LOC=c:\Users\James Oldiges\Desktop\Minecraft Server\world
set BACKUP_LOC=c:\Users\James Oldiges\Desktop\Backup
:: DO NOT EDIT BEYOND THIS LINE ::
for /F "tokens=2-4 delims=/- " %%A in ('date/T') do set TODAY=%%A-%%B-%%C

set BACKUP_LOC_TODAY=%BACKUP_LOC%\%TODAY%
cd "%BACKUP_LOC_TODAY%"

for /F %%A in ('chdir') do set CURRENT_DIR=%%A

if "%BACKUP_LOC_TODAY%" NEQ "%CURRENT_DIR%" (mkdir "%BACKUP_LOC_TODAY%")
xcopy "%WORLD_LOC%" "%BACKUP_LOC%\%TODAY%" /D /E /C /R /H /I /K /Y
« Last Edit: May 02, 2011, 07:57:41 pm by Happybobjr »
School: East Central High School
 
Axe: 1.0.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________