5nine Posted December 30, 2014 Report Share Posted December 30, 2014 I created this because i wanted an easier alternative to the log-rotator.cmd included with epoch. I also dont want to rotate my logs everytime i do a database backup. This creates a backup of your dump.rdb (your database) and sorts it in a folder named YEAR-MONTH (e.g. 2014-12). the actual filename also gets a date and timestamp like "Epoch-20141230_2205.rdb". So by using this you will get your backups nice and sorted with a folder for every month of the year. Step 1: create a batch file inside your C:\-arma3 server path-\DB folder (where redis-server.exe is located)and name it backup.cmd. Insert the code below: ::::::::::::::Created by Fivenine @ NibbleGaming.tk:::::::::::::: :::::::::::::: CONFIG :::::::::::::::::: :::: Set your Arma3 Server base installation directory below. set arma3srvpath=C:\YOUR ARMA 3\SERVER FOLDER\HERE :::: Set your Redis Password and IP below (found inside Redis.conf) set Redispass=ChangeMe set RedisIP=127.0.0.1 ::::::::::: ADVANCED CONFIG :::::::::::: :: Don't touch anything below this point unless you know what your doing. :::::::::::::::::::::::::::::::::::::::: :: Set Time and Date SET _CUR_DATE=%DATE% SET _CUR_TIME=%TIME% ::Setting date FOR /F "tokens=1-4 delims=/.- " %%a IN ("%_CUR_DATE%") DO SET MONTH=%%b FOR /F "tokens=1-4 delims=/.- " %%a IN ("%_CUR_DATE%") DO SET DAY=%%c FOR /F "tokens=1-4 delims=/.- " %%a IN ("%_CUR_DATE%") DO SET YEAR=%%a :: Setting Time FOR /F "tokens=1-4 delims=:." %%a IN ("%_CUR_TIME%") DO SET HOUR=%%a FOR /F "tokens=1-4 delims=:." %%a IN ("%_CUR_TIME%") DO SET MINUTE=%%b SET FOLDER_NAME=%YEAR%-%MONTH% SET BACKUP_FILE=Epoch-%YEAR%%MONTH%%DAY%_%HOUR%%MINUTE%.rdb :: Forcesave Redis Database redis-cli -h %RedisIP% -a %Redispass% save ::create folders if exist "%arma3srvpath%\DBbackups" goto createYDfolder mkdir "%arma3srvpath%\DBbackups" :createYDfolder if exist "%arma3srvpath%\DBbackups\%FOLDER_NAME%" goto startbackup mkdir "%arma3srvpath%\DBbackups\%FOLDER_NAME%" :startbackup copy "%arma3srvpath%\DB\dump.rdb" "%arma3srvpath%\DBbackups\%FOLDER_NAME%\%BACKUP_FILE%" :: Done exit step 2: Download Redis from here https://raw.github.com/mythz/redis-windows/master/downloads/redis64-latest.zip and copy redis-cli.exe from inside that .zip to your DB folder. step 3: Done! Now just run backup.cmd to perform your backup. I include it in my restart procedure using simple batch files. You can also schedule it to run using windows task scheduler or whatever suits you best. Having problems? I'm not sure if this works with every time and dateformat. So depending on where you live you might get a weird date and time format on your folders and files. If you do, simply create a batch file, call it timetest.cmd and insert this: @echo off echo %DATE% echo %TIME% timeout 120 Run that batch file and then copy paste the output here and i'll help you out. San and DamianL 2 Link to comment Share on other sites More sharing options...
Jobey Posted January 4, 2015 Report Share Posted January 4, 2015 this worked like a charm for me but can I just ask, how do you go about restoring the backup, still new at the DB side of things Link to comment Share on other sites More sharing options...
5nine Posted January 4, 2015 Author Report Share Posted January 4, 2015 this worked like a charm for me but can I just ask, how do you go about restoring the backup, still new at the DB side of things rename the backup you want to dump.rdb, copy and replace it in your DB folder while your redis server is shut down. Link to comment Share on other sites More sharing options...
OhDeathhhh Posted April 4, 2015 Report Share Posted April 4, 2015 This worked for me, but to char players. All constructions made by players, wall, lockbox, shelf gone. How to backup the construction? Link to comment Share on other sites More sharing options...
upperking Posted July 10, 2019 Report Share Posted July 10, 2019 Wed 07/10/2019 8:02:23.51 Link to comment Share on other sites More sharing options...
Ghostrider-GRG Posted July 11, 2019 Report Share Posted July 11, 2019 I just make a copy of dump.db with the date appended to the file name. On my server, I do this on a separate drive but you could do it anywhere. All the data you need is stored in that file. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now