darthmard Posted July 2, 2015 Report Share Posted July 2, 2015 I put together some code for a simple Redis backup for command I use it myself in a windows task simple to use for new server owners who like to use batch files. I know there's programs for this but I like to use batch files if done right uses less resources on server. Make a batch file (Backup.bat) or use in own restart batch if have one. @echo off color 0A echo Running Redis Database Backup.. echo. echo. IF Not EXIST C:\Database\dump.rdb GOTO DoNothing if not exist "C:\Database\backup" mkdir C:\Database\backup :: above checks for folders and file :: :: DO NOT EDIT for /F "tokens=2-4 delims=/ " %%i in ('date /t') do set yyyymmdd=%%k%%i%%j echo Date: %yyyymmdd% for /F "tokens=1-2 delims=: " %%l in ('time /t') do set hhmm=%%l%%m echo Time: %hhmm% :: END NO EDIT :: copy C:\Database\dump.rdb C:\Database\backup\dump.rdb :: REN C:\Database\backup\dump.rdb dump_%yyyymmdd%_%hhmm%.rdb echo. echo Backup was successfully completed! timeout 10 :: :: You can add database startup here if you want :: START redis-server.exe redis.conf :: echo Database started successfully! ::timout 10 exit This code will save DBdump.rdb and move to backup and rename it this example: dump_20150207_0201.rdb NOTE: I have my redis in c:\database you can edit this in batch code Caveman1 1 Link to comment Share on other sites More sharing options...
Halvhjearne Posted July 26, 2015 Report Share Posted July 26, 2015 there is already a backup tool in the server package ... lol Link to comment Share on other sites More sharing options...
Caveman1 Posted August 22, 2015 Report Share Posted August 22, 2015 Thank you DarthMard. Exactly what I was looking for and works great. Link to comment Share on other sites More sharing options...