[Admin] World Backup Script (.bat/.sh)

Discussion in 'Bukkit Tools' started by gohbender, May 17, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    gohbender

    Good evening mentlegen! I wrote a backup script for myself, and it turns out its pretty handy to have. So I am uploading it to you, the Intertubes.

    I originally wrote a backup script in powershell, then decided for no particular reason to write it in batch. Then, also for no particular reason, I rewrote it in a shell script for those misguided apple fans. I justified this by telling myself that linux users would also be able to use it. (just kidding, my friend is an apple user, wrote it for him : )

    oh, and if anyone wants the powershell script I can upload that as well. The powershell script can handle spaces much better than the shell script, not that that does linux/osx users a damn bit of good.

    Instructions for use in comments of files.

    What this script does:
    Disclaimer: This script copies/deletes folders and files. Read the comments in the files, and set things carefully. I will not be held responsible for anything stupid that you do using my script. (well, I might be held responsible, but I won't feel responsible.) Use common sense (eg. don't set C:\ as the backup folder).
    Windows:
    - Makes a scheduled task to run the script. (every hour by default)​
    - Delete old backups. (deletes backups older than 2 days by default)​
    - Can back up single or multiple worlds, you could easily make it back up the whole server folder(s) if you wanted to.​
    - If present also will backup worldname_nether and worldname_the_end
    Linux/OSX:
    - Same as Windows except it doesn't make a scheduled task, it sleeps for an hour after executing.​

    What this script does NOT do:
    - It does not have different backup times for different worlds. It does them all one after another when scheduled.​
    - I'm sure there are things that you want this script to that that it does not. Leave a comment, I'll see if I can help.​

    What to expect:
    - a backup folder structure that looks like this:​
    [​IMG]

    Some bugs I haven't taken care of:
    - The linux/OSX version does not like spaces in path names, like anywhere. SO NO SPACES. If anyone knows how to fix this please let me know, I'm a beginner when it comes to shell scripting.​
    - If the windows script is moved after first run the scheduled task will not know where to find it. (info to fix in comments of file)​
    - Also in the shell script, since it remains running and only executes once per hour, only run once I think multiple instances would be bad (extra backups/lag). go and stop extra backup.sh processes until there is only one.​
    - I'm sure there are others. If (when) you find some let me know I will try to fix them.​

    Download Links:
    Windows: backup.bat
    Pastebin: link
    Linux/OSX: backup.sh
    Pastebin: link
     
  2. Offline

    bgmw

    HI is very easy we must replace the space by _ in the name
     
Thread Status:
Not open for further replies.

Share This Page