Hi, I've created a batch file to automatically do a backup of my server. I want to create folders with date and time and delete folders older then 3 days old when the batch is run. here is what I have so far. ATM its just dumping the .db files into d:\WurmTSR\TSR\Backups\sqlite no folders or dates-time also not deleting old backups. I'm not very good with coding..
ECHO OFF
CD /D D:\WurmTSR\TSR\The Severed Realms\sqlite
FOR /R %%F in (*.db) do (
echo %%~nFz
sqlite3 %%~nF ".backup 'd:\WurmTSR\TSR\Backups\sqlite\%%~nF'"
)
ECHO ON
pause
I also need to make a backup of the world files into the same folder but with a sub folder "world" with date and time this is what I'm using atm...
ECHO OFF
xcopy /d /y /s "D:\WurmTSR\TSR\The Severed Realms\*.map" "D:\WurmTSR\TSR\backups\world"
xcopy /d /y /s "D:\WurmTSR\TSR\The Severed Realms\*.bmap" "D:\WurmTSR\TSR\backups\world"
ECHO ON
Pause
So hypothetically I would like to run both these codes in the same batch and have it take a copy of all the files and put them in D:\WurmTSR\TSR\backups with folder name eg backup_30-09-2018-6pm inside of that have a folder sqlite and one called world. the .db files go inside of "sqlite" and the .map files go inside "world" and any backup_date folders older then 3 days are deleted. Would also be great if it could automatically zip the folders to save space until they are deleted..