Announcement

Collapse
No announcement yet.

Backup Batch File.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Backup Batch File.

    If you're like me and hate the needless complexity of backup software, you can find as I did that a simple batch file will take care of all your needs. Here is the script I use for Prometheus which backs it up to two separate locations. It backs up only my game's files, not the entire UDK, which saves space as one of the locations I back it up to is a thumb drive. Feel free to use this for your own projects! Just copy this into a text file, change the directory and file information, and change the extension to .bat and you're done! Double click on this file and it will automatically update any changed files to your backups, so it doesn't waste time backing everything up if only a few files have changed.

    Happy developing!

    Code:
    @echo off
    set backupcmd=xcopy /s /c /d /e /h /i /r /y
    
    echo ### Backing up art assets...
    set driveone=D:\PrometheusBackup\ArtAssets
    set drivetwo=E:\PrometheusBackup\ArtAssets
    %backupcmd% "C:\Files\Prometheus" "%driveone%"
    %backupcmd% "C:\Files\Prometheus" "%drivetwo%"
    
    echo ### Backing up UDK files...
    set driveone=D:\PrometheusBackup\UDK
    set drivetwo=E:\PrometheusBackup\UDK
    %backupcmd% "C:\UDK\UDK-Prometheus\Development\Src\Prometheus" "%driveone%\UDK-Prometheus\Development\Src\Prometheus"
    %backupcmd% "C:\UDK\UDK-Prometheus\Development\Src\Prometheus" "%drivetwo%\UDK-Prometheus\Development\Src\Prometheus"
    %backupcmd% "C:\UDK\UDK-Prometheus\UDKGame\Content\Maps" "%driveone%\UDK-Prometheus\UDKGame\Content\Maps"
    %backupcmd% "C:\UDK\UDK-Prometheus\UDKGame\Content\Maps" "%drivetwo%\UDK-Prometheus\UDKGame\Content\Maps"
    %backupcmd% "C:\UDK\UDK-Prometheus\UDKGame\Content\Prometheus" "%driveone%\UDK-Prometheus\UDKGame\Content\Prometheus"
    %backupcmd% "C:\UDK\UDK-Prometheus\UDKGame\Content\Prometheus" "%drivetwo%\UDK-Prometheus\UDKGame\Content\Prometheus"
    %backupcmd% "C:\UDK\UDK-Prometheus\UDKGame\Script\Prometheus.u" "%driveone%\UDK-Prometheus\UDKGame\Script"
    %backupcmd% "C:\UDK\UDK-Prometheus\UDKGame\Script\Prometheus.u" "%drivetwo%\UDK-Prometheus\UDKGame\Script"
    %backupcmd% "C:\UDK\UDK-Prometheus\UDKGame\Movies\Pr*.bik" "%driveone%\UDK-Prometheus\UDKGame\Movies"
    %backupcmd% "C:\UDK\UDK-Prometheus\UDKGame\Movies\Pr*.bik" "%drivetwo%\UDK-Prometheus\UDKGame\Movies"
    %backupcmd% "C:\UDK\UDK-Prometheus\UDKGame\Splash\PC\Splash.bmp" "%driveone%\UDK-Prometheus\UDKGame\Splash\PC"
    %backupcmd% "C:\UDK\UDK-Prometheus\UDKGame\Splash\PC\Splash.bmp" "%drivetwo%\UDK-Prometheus\UDKGame\Splash\PC"
    %backupcmd% "C:\UDK\UDK-Prometheus\UDKGame\Config\DefaultEngine.ini" "%driveone%\UDK-Prometheus\UDKGame\Config"
    %backupcmd% "C:\UDK\UDK-Prometheus\UDKGame\Config\DefaultEngine.ini" "%drivetwo%\UDK-Prometheus\UDKGame\Config"
    %backupcmd% "C:\UDK\UDK-Prometheus\UDKGame\Config\DefaultEngineUDK.ini" "%driveone%\UDK-Prometheus\UDKGame\Config"
    %backupcmd% "C:\UDK\UDK-Prometheus\UDKGame\Config\DefaultEngineUDK.ini" "%drivetwo%\UDK-Prometheus\UDKGame\Config"
    %backupcmd% "C:\UDK\UDK-Prometheus\UDKGame\Config\DefaultGame.ini" "%driveone%\UDK-Prometheus\UDKGame\Config"
    %backupcmd% "C:\UDK\UDK-Prometheus\UDKGame\Config\DefaultGame.ini" "%drivetwo%\UDK-Prometheus\UDKGame\Config"
    %backupcmd% "C:\UDK\UDK-Prometheus\UDKGame\Config\DefaultInput.ini" "%driveone%\UDK-Prometheus\UDKGame\Config"
    %backupcmd% "C:\UDK\UDK-Prometheus\UDKGame\Config\DefaultInput.ini" "%drivetwo%\UDK-Prometheus\UDKGame\Config"
    
    echo Backup Complete!
    @pause

    #2
    Useful tool, thanks for sharing.

    Maybe obvious, but just in case for people not used with .bat file notice AngelMapper's example makes two backups, so if you don't need two, delete all lines with "drivetwo" inside.

    Comment

    Working...
    X