So you want backups of your database ? Yes, of course !
The output is pretty small, don't be afraid , they are not 8Gb dumps every time, but really, really small.
Quick and dirty, not too much explanation needed, so here are the 2 batch files you need :
1] Get redis-cli.exe (provided in the redis distribution ZIP). Place it in the same folder as redis-server.exe
2] Create a batchfile in the DB folder (by default "C:\Program Files (x86)\Steam\SteamApps\common\Arma 3\DB") called rdate.cmd. Copy the following text in it and save.
@echo off rem ******************************************************************* rem rem Set environment variables with date/time information. rem rem DT_MONTH .................... Two digit month rem DT_DAY ...................... Two digit day rem DT_YEAR ..................... Four digit year rem DT_HOUR ..................... Two digit hour rem DT_MINUTE ................... Two digit minute rem DT_SECOND ................... Two digit second rem DT_RFC ...................... YYYYMMDDTHHMMSS rem rem ******************************************************************* rem Grab date and time values for conversion. SET _CUR_DATE=%DATE% SET _CUR_TIME=%TIME% FOR /F "tokens=1-4 delims=/.- " %%a IN ("%_CUR_DATE%") DO SET DT_MONTH=%%b FOR /F "tokens=1-4 delims=/.- " %%a IN ("%_CUR_DATE%") DO SET DT_DAY=%%c FOR /F "tokens=1-4 delims=/.- " %%a IN ("%_CUR_DATE%") DO SET DT_YEAR=%%d rem Convert from "11:40:12.82" to individual parts by using a DOS FOR loop. FOR /F "tokens=1-4 delims=:." %%a IN ("%_CUR_TIME%") DO SET DT_HOUR=%%a FOR /F "tokens=1-4 delims=:." %%a IN ("%_CUR_TIME%") DO SET DT_MINUTE=%%b FOR /F "tokens=1-4 delims=:." %%a IN ("%_CUR_TIME%") DO SET DT_SECOND=%%c SET DT_RFC=%YEAR%%MONTH%%DAY%T%HOUR%%MINUTE%%SECOND%
3] Create a batchfile in the same folder called backup.cmd and paste the following code in.
@echo off rem If you want to skip backups, delete the REM at the next line rem goto notthistime C: cd "C:\Program Files (x86)\Steam\SteamApps\common\Arma 3\DB" call rdate.cmd SET YEAR=%DT_YEAR% SET MONTH=%DT_MONTH% SET DAY=%DT_DAY% SET HOUR=%DT_HOUR% SET MINUTE=%DT_MINUTE% SET SECOND=%DT_SECOND% SET BACKUP_FILE=Epoch-%YEAR%-%MONTH%-%DAY%-%HOUR%.rdb rem redis-cli.exe is in the ZIP file obtained from the Redis site. del dump.rdb /y redis-cli -a <YOURREDISPASSWORDHERE> save rename dump.rdb %BACKUP_FILE% rem the next line copies the DB to a different location for safe keeping. rem xcopy %BACKUP_FILE% <safe backuplocation> rem then also unremark next line to delete the dumpfile from the dabatase folder. rem del %BACKUP_FILE% /y :notthistime
To manually perform a backup, just start the backup.cmd and after dumping it will rename the output to a file named Epoch-year-month-day-hour.rdb
If you want, remove some remarks to copy the created file to another location on your network and delete the dumpfile.
To schedule it :
If you have command prompt access , execute these commands elevated (Execute as Administrator) :
cmd.exe (run as admin!)
schtasks /create /tn "redis Backup" /tr "C:\Program Files (x86)\Steam\SteamApps\common\Arma3\DB\backup.cmd" /sc hourly /st 00:00
If you do not have access to the command prompt, find your way to the scheduler and put them in at your required times.
It also gives you the options to run the tasks Interactive, which will have a visible command window on your desktop.. The commands from the stuff above exectutes the tasks invisible !!
----------------
To restore (and correct me if I'm wrong, it looks plain and simple) :
Stop Redis, delete dump.rdb , copy the desired backupfile back to the DB folder and rename it to dump.rbd, restart Redis, done !
----------------
----------------
Redis makes a dump.rdb itself once every xx minutes, but this methode forces a timed backup of the exact time you want.
----------------
Have fun,
NedFox [TZW]
TimeZone Warriors/GOB Server : 80.60.255.84:2324