[guide] One-click backup method per batch file

Hello grim looters!

In the last few days i saw a lot of people having issues with loosing their shared stash. Here’s another qol improvement to handle backups.

An easy One-click backup method per *.bat file that uses inherent xcopy feature of windows.

The only thing you need to do is creating this file and enter the origin path and the destination path where the saves should be backed up in. The batchfile should work with every Windows version from at least XP to Win 10.

How to:

Open up a text editor of your choice or create a new *.txt file (right click desktop/new/textdocument) Type as follows into the text editor:

XCOPY "[b]X[/b]:\Users\[i]your_username[/i]\Documents\My Games\Grim Dawn\save" "DESTINATION BACKUP DIRECTORY" /D /E /C /R /I /K /Y

[ul]Keep the inverted commas.
[li]X is the drive you keep your My Documents folder with local Grim Dawn saves. It’s the origin of the save files you want to backup. Make sure that the path is correct. I recommend to turn steam cloud off and use local saving. If you not do already see here: How to - Move your saves from Steam cloud to Grim Dawn’s default location.[/li]If you want to use steam cloud you should instead use the cloud save directory. This would be:
X:[i]your steam directory[/i]\userdata[i]afolderwithnumbers[/i]\219990\remote\save
[li]DESTINATION BACKUP DIRECTORY stands for the path into a folder of your choice you want to backup the files to from the origin directory (for example D:\Backups\Grim_Dawn\local_saves).[/li]
[/ul]

/D /E /C /R /I /K /Y are commands that do as following:

[ul]

/D - Tells XCopy to copy all source files that are newer than files in the destination folder.
[li]/E - Copies all subdirectories, even if empty.[/li] [li]/C - Ignores errors.[/li] [li]/R - Copies read-only files.[/li] [li]/I - Will create a folder in the desired destination spot if one does not already exist.[/li] [li]/K - Copies and keeps read-only attributes on files that are set that way.[/li] [li]/Y - Removes confirmation prompt for overwriting of files.[/ul][/li]
More commands you might use as an advanced user can be looked up here:
https://technet.microsoft.com/en-us/library/bb491035.aspx

Example how mine looks like:

XCOPY "C:\Users\user\Documents\My Games\Grim Dawn\save" "F:\BCKUP\Backup_saves_Grim_Dawn_per_bat" /D /E /C /R /I /K /Y

[ul]Save the file with a name you like. For example: Grim_Dawn_local_bckup
[li]The file now keeps the file extension .txt because it is a text file. You only need to change the, for example “Grim_Dawn_local_bckup.txt”, now to “Grim_Dawn_local_bckup.bat” Confirm the change witk OK. The icon might change to the typical gear wheel icon of a batchfile. If your file extension does not show up -here is how to make these visible. If you want to set up another directory or expand the code you can switch between.txt and *.bat whenever you need it.[/li]
[/ul]

Your batchfile is now ready to use!

Whenever you click it, your save files will be copied to the destination folder you had set up or update the files in your backup folder.

source:
http://forums.runicgames.com/viewtopic.php?f=30&t=52648#p445159 Thanks to Prateem and coauthors

I also link the already existing guide from the GD forum with some other different solutions you can choose from.
http://www.grimdawn.com/forums/showthread.php?t=10564

1 Like

This is a moderated section of the forums, but I approved this in hopes that you pull a bit more detail from your link and show an example gd version here. I realize everyone will need specific paths for their computer, but a GD specific guide is in order, imo. Thanks.

having a 1 click backup system is handy, but yeah, I think some more details need to be put down. for me personally, I just zip the whole GD save folder and paste that to another directory.

Another thing I’ve recently started to use, well the program itself I have been using for a long time. is directory opus, (windows explorer / file manager) and it has a synch function I’m trying, so that it only copies files to another directory if they have changed.

but I guess there are a few ways people can backup their saves. Then again, making regular backups of anything, (windows, save data, documents, etc, is always a good idea.

but anyway, as long as people do remember to backup their data, then that is something.

Hope this works out.

Thanks for taking the time to update the OP. Now, how do we get everyone to implement it?

Thanks for this. Backing up saves is no longer such a pain!

Hi together,

here are my code with some more features:

first thing is backup to other disk / please note that shold not be another partition, it should be a standalone disk!

it works with german date format, could be that you have to change some variables with googles help.

create batchfile as described in thread:

@echo off
set jahr=%date:~-4%
set monat=%date:~-7,2%
set tag=%date:~-10,2%
set stunden=%Time:~-11,2%
set minuten=%Time:~-8,2%
set sekunden=%Time:~-5,2%

timeout /T 1 (just a little break along the code it will appear to give some time to complete some actions)

mkdir “[b]S:\GDBackup[/b]%tag%.%monat%.%jahr%” REM Just create folder on destination

timeout /T 1
mkdir “[b]S:\GDBackup[/b]%tag%.%monat%.%jahr%%stunden%h%minuten%m%sekunden%s%” REM just make a folder under actual Date Folder with Time

timeout /T 1
xcopy /E “%USERPROFILE%\Documents\My Games\Grim Dawn\save” “[b]S:\GDBackup[/b]%tag%.%monat%.%jahr%%stunden%h%minuten%m%sekunden%s%” REM copies the saves to your new created folder
timeout /T 1
exit


here comes backup to usb drive

  1. you have to create shared folder on USB drive, cause driveletter may change on plugin

  2. check code

2.1steps in code
2.1.1 mapping network drive z:
2.1.2 create folder
2.1.3 copy files
2.1.4 unmapp Z: (mapped drive)

net use z: /delete
net use z: \PCNAME\GDBackupUSB
timeout /T 1
mkdir [b]z:[/b]%tag%.%monat%.%jahr%
timeout /T 1
mkdir [b]z:[/b]%tag%.%monat%.%jahr%%stunden%h%minuten%m%sekunden%s%
timeout /T 1
xcopy /E “%USERPROFILE%\Documents\My Games\Grim Dawn\save” z:%tag%.%monat%.%jahr%%stunden%h%minuten%m%sekunden%s%
timeout /T 5
net use z: /delete
timeout /T 1

if you want to check if game is running following code is working:
dont forget to set PROGRAMM
set Programm=Grim Dawn
tasklist |find /i “%Programm%” >nul
if %errorlevel% == 0 (

here should be the code if grimdwan is running*
) else
( exit)


Here is complete code any description:

@echo off
REM if grim dawn is started backup to other disc and USB drive

set jahr=%date:~-4%
set monat=%date:~-7,2%
set tag=%date:~-10,2%
set stunden=%Time:~-11,2%
set minuten=%Time:~-8,2%
set sekunden=%Time:~-5,2%
set Programm=Grim Dawn

	REM 1. Program started?

tasklist |find /i “%Programm%” >nul

	REM 2. if started then backup!

if %errorlevel% == 0 (
echo software “%Programm%” is running!

REM Festplatte Backup

timeout /T 1
mkdir "S:\GDBackup\%tag%.%monat%.%jahr%"
timeout /T 1
mkdir "S:\GDBackup\%tag%.%monat%.%jahr%\%stunden%h%minuten%m%sekunden%s%"
timeout /T 1
xcopy /E "%USERPROFILE%\Documents\My Games\Grim Dawn\save" "S:\GDBackup\%tag%.%monat%.%jahr%\%stunden%h%minuten%m%sekunden%s%"
timeout /T 5

	REM USB Backup

net use z: /delete
net use z: \\YOUR-PC\SHAREDFOLDER
timeout /T 1
mkdir z:\%tag%.%monat%.%jahr%
timeout /T 1
mkdir z:\%tag%.%monat%.%jahr%\%stunden%h%minuten%m%sekunden%s%
timeout /T 1
xcopy /E "%USERPROFILE%\Documents\My Games\Grim Dawn\save" z:\%tag%.%monat%.%jahr%\%stunden%h%minuten%m%sekunden%s%
timeout /T 5
net use z: /delete
timeout /T 1


) else ( 
	REM 3. if program not started then close!
echo  Software "%Programm%" nor running!
timeout /T 2

exit
)


you have to change personal folders or settings in script otherwise it will not work correctly. All FAT Marked words in first description code have to be changed to logical local settings

Also you can make auto Task in Windows all 15 minutes, if you play you get backup automatically all 15 minutes. to clean out i have another script which delete Folders older than 5 days. please let me know when someone need this code.

i hope someone can handle this my first post ever xD sorry
kind regards
R3SO;)

Since some people out there have been complaining about lost characters or stashed items after installing AoM I recommend to turn off steam cloud and to make a backup of your save files from time to time. To make this easier and more comfortable for you may consider a solution which is demonstrated in the opener. Have fun with the game everybody :smiley: