Help with Essentials Backup

Discussion in 'Spigot Plugin Help' started by floory565, Jun 8, 2016.

  1. floory565


    Hi all,

    Essentials allows you to backup server folders:

    The suggested code for the batch file used to back folders on a Windows computer is:
    Code (Text):
    SET itdate=%date:~-10%
    SET itdate=%itdate:~6,4%-%itdate:~3,2%-%itdate:~0,2%
    echo Current date: %itdate%
    xcopy /e /c /h /i /v /r /y /q world Backup\%itdate%D\
    SET hour=%time:~0,2%
    IF "%hour:~0,1%" == " " SET hour=0%hour:~1,1%
    xcopy /e /c /h /i /v /r /y /q Backup\%itdate%D Backup\%itdate%-%hour%H\
    echo Backup Complete (assuming no errors above).  Attempting to remove old files..
    forfiles /p "Backup" /m "*H" /c "cmd /c rmdir /s /q @path" /d -2
    forfiles /p "Backup" /m "*D" /c "cmd /c rmdir /s /q @path" /d -14
    The line:
    Code (Text):
    xcopy /e /c /h /i /v /r /y /q world Backup\%itdate%D\
    specifies the folder 'world' to be backed up.

    How would I alter the folder path to instead backup the entire server folder? And how would I alter the resulting path to save the backup as a .zip?

    Thanks in advance!
  2. floory565


  3. I haven't used this feature of Essentials before, and this very well may not work, but you could try changing that one line to something like this:
    Code (Text):
    xcopy /e /c /h /i /v /r /y /q / Backup\%itdate%D\
    Changing "world" to "/" should tell it to backup everything instead of just the world folder. Adding is more of a "it's worth a shot" thing. You'd probably have to modify the script to zip up the folder after it gets backed up. Google should be able to help you with that part of it. ;)
  4. floory565


    Cheers, I'll give it a test this afternoon!
  5. floory565


    Unfortunately neither a forward slash nor backward slash worked.