The Task Creation Table

This particular guide illustrates how to save 9 full backups on a revolving basis. here

Target Archive Full-.tib note the hyphen ATI-Full Drive W: Backup Location W:\ATI-Full\Full-.tib note the single hyphen

post After Backup Process W:\Rename-Full.bat

Rename-Full.bat Post command Full-.tib –

Rename-ful.bat RENAME-FULL.BAT

Line 1= OFF Line 2= W: Line 3= CHDIR W:\ATI-FULL Line 4= IF NOT EXIST Full-.tib Line 5= IF EXIST Full-9.tib DEL Full-9.tib Line 6= IF EXIST Full-8.tib Full-8.tib Full-9.tib Line 7= IF EXIST Full-7.tib REN Full-7.tib Full-8.tib Line 8= IF EXIST Full-6.tib REN Full-6.tib Full-7.tib Line 9= IF EXIST Full-5.tib REN Full-5.tib Full-6.tib Line 10= IF EXIST Full-4.tib REN Full-4.tib Full-5.tib Line 11= IF EXIST Full-3.tib REN Full-3.tib Full-4.tib Line 12= IF EXIST Full-2.tib REN Full-2.tib Full-3.tib Line 13= IF EXIST Full-1.tib REN Full-1.tib Full-2.tib Line 14= IF EXIST Full-.tib REN Full-.tib Full-1.tib Line 15= EXIT

Line # Batch Command Explanation

1 Turns off the display of batch file execution.

2 Drive letter of storage disk. The batch file positions the program inside this .

3 Changes directory to storage drive and storage folder so program will begin inside storage folder.

4 Checks to see if the regular Full.tib backup has been created. ...If file does not exist, the batch files exits with no action taken and awaits the next run. ...If file does exist, the backup creation was successful and program continues to line 5.

5 Checks for existence of the oldest file(#9). If file 9 exists, the batch executes the DEL command which deletes the oldest backup file and continues to line 6. Windows will not allow two files with the same name so #9 must be deleted so line 6 can do its job. If backup full-9.tib does not exist, no action taken and program continues to line 6.

6 Checks for the existence of the next oldest file.. If file #8 exists, the batch executes a renaming of #8 to a new name of Full-9.tib and continues to line 7. If backup file #8 folder does not exist, no action is taken and program continues to line 7.

7-13 A repeat of Line 6 except each old backup file number decreases (-1) on each line, while the new rename increases by one on each line.

14 This line renames Full-.tib to its new name of Full-1.tib and awaits the creation of the next regular Full- .tib archive backup file.

Note-1 It is line 5 which controls how many backup sets are retained. To change the number of backups files to be retained, adjust line 5 and line 6 to add or remove backup files.

Note-2 The line number column is for informational display and not part of the actual file. Batch Command Explanation

Red Blue Green ECHO OFF X: X:\folder name EXIT IF EXIST IF NOT EXIST DEL REN CHDIR /S /Q

Task Creation Table Backup Wizard Required Steps

“” Full-.tib W:\ATI-Full\FULL-.TIB

W:\Rename-Full.bat

Task Figure 1 Required Steps

Task Figure 2 Required Steps Figure 3 A folder results view

Figure 3 shows the successful creation of backup sets for 9 prior full backups. In this example, one full backup is created every the user scheduled task is run. After each run, each prior existing backup is renamed older. When max number is achieved, oldest file is always deleted so as to always maintain the specified 9 backup sets.

Miscellaneous

1. Examples of batch files with varying retention settings listed on next page.

2. To change drive letter of external drive: A. Right click on MyComputer and select Manage and the select Disk or Computer Management. B. Right click on the drive/disk to be changed. C. Select Change Drive Letter and Seledt a new Drive Letter such as W or X or Y or Z D. Click OK to complete the change. If a name has not been assigned to your drive, do so now.

3. It is a good idea to occasionally check all your drives for disk errors. You should certainly do so before implementing a procedure of several backups. Best time to do this is to let the checking be performed overnight as the check may consume several hours.

- - Go to the Command Prompt ( -> Run -> cmd)

- - Enter the command: " DISK: /r" (where DISK is the partition letter you need to check) for every partition that is visible in My Computer. Please note, that checking the C: drive may require you to reboot the machine. An example is CHKDSK C: /R

Testing can be done very easily once you get all the pieces together. You don't have to wait for the schedule to complete. The testing can be accomplished by running the scheduled task manually several times back to back (waiting just enough time between runs to allow each task run to complete) to see if the backups are completed and files renamed.

Batch file= Rename-FULL.bat Produced by Grover Hatcher October 19, 2009 Batch file sample contents Any of these samples can be copied into your and pasted into Notebook. Change drive letter and folder name to meet our own requirements. After modification, the file can then be saved into the main directory of the backup storage drive, which in this example is W:\Rename-full.bat as illustrated by Task Figure 2 above.

REM Will retain 12 full backups REM Batch file name is Rename-Full.bat REM Will retain 9 full backups REM Batch file name is Rename-Full.bat ECHO OFF REM as illustrated above W: CHDIR W:\ATI-Full IF NOT EXIST Full-.tib EXIT ECHO OFF IF EXIST Full-12.tib DEL Full-12.tib W: IF EXIST Full-11.tib REN Full-11.tib Full-12.tib CHDIR W:\ATI-Full IF EXIST Full-10.tib REN Full-10.tib Full-11.tib IF NOT EXIST Full-.tib EXIT IF EXIST Full-9.tib REN Full-9.tib Full-10.tib IF EXIST Full-9.tib DEL Full-9.tib IF EXIST Full-8.tib REN Full-8.tib Full-9.tib IF EXIST Full-8.tib REN Full-8.tib Full-9.tib IF EXIST Full-7.tib REN Full-7.tib Full-8.tib IF EXIST Full-7.tib REN Full-7.tib Full-8.tib IF EXIST Full-6.tib REN Full-6.tib Full-7.tib IF EXIST Full-6.tib REN Full-6.tib Full-7.tib IF EXIST Full-5.tib REN Full-5.tib Full-6.tib IF EXIST Full-5.tib REN Full-5.tib Full-6.tib IF EXIST Full-4.tib REN Full-4.tib Full-5.tib IF EXIST Full-4.tib REN Full-4.tib Full-5.tib IF EXIST Full-3.tib REN Full-3.tib Full-4.tib IF EXIST Full-3.tib REN Full-3.tib Full-4.tib IF EXIST Full-2.tib REN Full-2.tib Full-3.tib IF EXIST Full-2.tib REN Full-2.tib Full-3.tib IF EXIST Full-1.tib REN Full-1.tib Full-2.tib IF EXIST Full-1.tib REN Full-1.tib Full-2.tib IF EXIST Full-.tib REN Full-.tib Full-1.tib IF EXIST Full-.tib REN Full-.tib Full-1.tib EXIT EXIT

REM Will retain 16 full backups REM Batch file name is Rename-Full.bat

ECHO OFF REM Will retain 6 full backups W: REM Batch file name is Rename-Full.bat CHDIR W:\ATI-Full IF NOT EXIST Full-.tib EXIT ECHO OFF IF EXIST Full-16.tib DEL Full-16.tib W: IF EXIST Full-15.tib DEL Full-15.tib Full-16.tib CHDIR W:\ATI-Full IF EXIST Full-14.tib REN Full-14.tib Full-15.tib IF NOT EXIST Full-.tib EXIT IF EXIST Full-13.tib REN Full-13.tib Full-14.tib IF EXIST Full-6.tib DEL Full-6.tib IF EXIST Full-12.tib DEL Full-12.tib Full-13.tib IF EXIST Full-5.tib REN Full-5.tib Full-6.tib IF EXIST Full-11.tib REN Full-11.tib Full-12.tib IF EXIST Full-4.tib REN Full-4.tib Full-5.tib IF EXIST Full-10.tib REN Full-10.tib Full-11.tib IF EXIST Full-3.tib REN Full-3.tib Full-4.tib IF EXIST Full-9.tib REN Full-9.tib Full-10.tib IF EXIST Full-2.tib REN Full-2.tib Full-3.tib IF EXIST Full-8.tib REN Full-8.tib Full-9.tib IF EXIST Full-1.tib REN Full-1.tib Full-2.tib IF EXIST Full-7.tib REN Full-7.tib Full-8.tib IF EXIST Full-.tib REN Full-.tib Full-1.tib IF EXIST Full-6.tib REN Full-6.tib Full-7.tib EXIT IF EXIST Full-5.tib REN Full-5.tib Full-6.tib IF EXIST Full-4.tib REN Full-4.tib Full-5.tib IF EXIST Full-3.tib REN Full-3.tib Full-4.tib IF EXIST Full-2.tib REN Full-2.tib Full-3.tib IF EXIST Full-1.tib REN Full-1.tib Full-2.tib IF EXIST Full-.tib REN Full-.tib Full-1.tib EXIT

REM Will retain 4 full backups REM Batch file name is Rename-Full.bat REM Will retain 3 full backups REM Batch file name is Rename-Full.bat ECHO OFF W: ECHO OFF CHDIR W:\ATI-Full W: IF NOT EXIST Full-.tib EXIT CHDIR W:\ATI-Full IF EXIST Full-4.tib DEL Full-4.tib IF NOT EXIST Full-.tib EXIT IF EXIST Full-3.tib REN Full-3.tib Full-4.tib IF EXIST Full-3.tib DEL Full-3.tib IF EXIST Full-2.tib REN Full-2.tib Full-3.tib IF EXIST Full-2.tib REN Full-2.tib Full-3.tib IF EXIST Full-1.tib REN Full-1.tib Full-2.tib IF EXIST Full-1.tib REN Full-1.tib Full-2.tib IF EXIST Full-.tib REN Full-.tib Full-1.tib IF EXIST Full-.tib REN Full-.tib Full-1.tib EXIT EXIT