[Guide] Auto-backup for mappers

  • Hi!

    Since I already messed up really hard sometimes and didn't have a backup, i was thinking about a solution. Did this with Powershell and task scheduler from Windows.


    Tested on Windows 10 Pro 1909 (Build 18363.720) , works with everything higher than WinXP


    Step 1

    Be sure you are allowed to run powershell scripts
    Open powershell as administrator and type

    Code
    1. Set-ExecutionPolicy Unrestricted

    (on own risk, that makes you able to run all ps1 scripts!)


    Step 2

    Edit the variables and save the script on your computer

    Code
    1. $mapfile = "C:\CoD4 Compile Tools\map_source\mp_glados.map"
    2. $script = "C:\CoD4 Compile Tools\raw\maps\mp\mp_glados.gsc"
    3. $path = "\\rextrus.com\data\CoD4 Backups"
    4. $newPath = New-Item -ItemType Directory -Path "$path\$((Get-Date).ToString('yyyy-MM-dd-%H-mm'))"
    5. Copy-Item $mapfile -Destination $newPath
    6. Copy-Item $script -Destination $newPath


    Step 3

    Open taskschd.msc in Run

    Add a new task

    Now give this task a name, only run when you are signed in and also run with high privileges.


    Go to the header Trigger and add a trigger which looks like this


    Go to the header actions at run this program:

    C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe

    and add this argument in the box below:

    -command "C:\Users\username\Documents\map_backup.ps1"


    Thats basically it. Now you got a backup for every hour which you turn off or on every time in the task shedueler.





    Happy mapping.