Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- set done=0
- start elona.exe
- :backup
- set Year=
- for /f "skip=2" %%x in ('wmic Path Win32_LocalTime get Year^,Month^,Day^,Hour^,Minute^,Second /Format:List') do (
- if not defined Year set %%x
- )
- if %Month% LSS 10 set Month=0%Month%
- if %Day% LSS 10 set Day=0%Day%
- if %Minute% LSS 10 set Minute=0%Minute%
- if %Hour% LSS 10 set Hour=0%Hour%
- set Timestamp=%Year%.%Month%.%Day% %Hour%%Minute%
- xcopy /s /i /y save "backups\%Timestamp%" >NUL
- if %done%==0 goto sleep
- exit
- :sleep
- set sleep=0
- :sleeploop
- ::Check if Elona is running. If it is, loop. If not, we do a final backup and we're done.
- tasklist /FI "IMAGENAME eq elona.exe" 2>NUL | find /I /N "elona.exe">NUL
- if not "%ERRORLEVEL%"=="0" set done=1 & goto backup
- ::Ping nothing and output nothing for five seconds. Equivalent to "sleep" or "wait".
- ping -n 6 127.0.0.1 >NUL
- set /A sleep+=1
- ::Sleep 360 times (thirty minutes) then backup.
- if %sleep% lss 360 goto sleeploop
- goto backup
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement