Backup Schedule
I would like to schedule backups and incrementals on specified date.
E.g. Full backup on Sunday night only and incremental on other days except on Sunday.
If an incremental gets missed the schedule shifts when doing 1 full and 6 incremental. I want the full to only happen on Sunday and do incremental the other days regardless if one or two incremental failed.
- Accedi per poter commentare
Following is a batch I made to start a new generation (set) whenever the month has changed from the last incremental. It should be easy to change to what you desire.
========================================
This BATCH uses your default system date. To check your Date setting:
1. Open a CMD window by typing CMD and in the Start-Run Box.
2. Enter SET M=%date:~-10,2% into the CMD window and
3. Enter Echo M=%M% into the CMD window and
4. If M is two digit month then OK
5. If M is NOT two digits then repeat from #2 changing the "10"
If the "10" required a change then change the first line of the batch to match.
After SET LOC= enter the location that contains your ATI sets. End with a \ and without < >.
example: "\\NAS\AcronisImages\ (Note leading ", ending \ only)
Test your Batch by:
1. Make new folders New0 and New1 in your location containing the ATI sets.
2. Copy any file into New0 and rename it with a leading 0.
3. Copy any file into New1 and rename it with a leading 1.
4. Make a copy of the Batch.
DO THE FOLLOWING IN THE BATCH COPY
5. Change every Set to New
6. Run the batch
7. Check that New0 is empty
8. Check that New1 contains your test file with a leading 0
9. If everything is OK then Delete New0, New1, and the Batch COPY.
:: =========================================================
:: Establish if Last Image was done in the Current Month and if NOT force New Generation
:: -----------------------------------------------------------------------------------------------------------
SET M=%date:~-10,2%
SET LOC="
DIR /O:D /B %LOC%set0\*.tib" >%LOC%Test.txt"
for /f "tokens=* delims= " %%a in (%LOC%Test.txt") do (SET LASTF=%%a)
DIR %LOC%set0\%LASTF%" > %LOC%Test.txt"
FINDSTR /C:%LASTF% %LOC%Test.txt">%LOC%Test2.txt"
FOR /f "tokens=1 delims=/" %%M in (%LOC%Test2.txt") DO SET LASTM=%%M
DEL %LOC%Test?.txt"
IF %LASTM%==%M% GOTO RunATI
:: Month has changed so move set0 into set1 and make new set0
:: -----------------------------------------------------------------------------------------------------------
RMDIR /S /Q %LOC%set1"
RENAME %LOC%set0" set1
MKDIR %LOC%set0"
:RunATI
:: ===========================================================
- Accedi per poter commentare