Quantcast
Channel: 2BrightSparks
Viewing all articles
Browse latest Browse all 9303

Empty diff folder on rescan

$
0
0
For my current back-up strategy I basically use the following:

All backups are compressed and saved as a single ZIP file. The file name is "%DAYOFWEEK%-%HOUROFDAY%.zip". The differential backups are stored in a folder "\diff\". A differential backup is made every hour.

The full backup archives are called "%DATE%.zip" and are stored in a folder called "\full\". Every monday (%DAYOFWEEK% equals 1) a full backup takes place. I use a script to make sure only one rescan takes place on a Monday, all other runs are considered as differential backups.

Question/Problem
When a rescan/full backup takes place on Monday, I want to empty the /diff/ folder. The reasons for this is that the folder gets cluttered with old archives. When there is a archive "Fri-13.zip" from a previous week, and my PC is off on that hour in the current week the archive stays in place and is not deleted.

Effectivly this means that Fri-13.zip is current, Fri-14.zip is from previous week and Fri-15 is current again (in case my PC would be turned of for the 14th hour only).

To summerize:
Every first backup on a Monday is a full backup which goes into /full/, at that moment I want to clear all differential archives from the /diff/ folder. How can I achieve what I want? I checked the scripts and help file but I wasn't able to achieve what I require.

Viewing all articles
Browse latest Browse all 9303

Trending Articles