Answer the question
In order to leave comments, you need to log in
How to take into account the reset of the system time?
Good day.
There is a backup script:
@Echo Off
echo %date% %time% ***Start***
SetLocal EnableDelayedExpansion
Set $SRC=list_add.txt
Set $EXC=list_excl.txt
Set $DIR=C:\backtest
Set $PSW=1
Set $COMPR=5
Set $COPIES=7
C:\"Program Files"\7-Zip\7z.exe a -t7z "%$DIR%\file%DATE:~-4%-%DATE:~3,2%-%DATE:~0,2%_%TIME:~0,2%-%TIME:~3,2%-%TIME:~6,2%.7z" @%$SRC% -scsWIN -p%$PSW% -mx=%$COMPR% -ssw [email protected]%$EXC% >> log_7z.log
For /F "Delims=" %%i In ('DIR /B/O:-N %$DIR%\file????-??-??_??-??-??.7z') Do (
Set /A $COPIES-=1
If !$COPIES! LSS 0 DEL "%$DIR%\%%i"
)
echo %date% %time% ***End***
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question