I am at a loss and hope someone can spread some light on this and tell me where it went wrong.
I have been running the below script for some time. AT one time it worked perfectly deleting all data over 89 days in the folder names listed in the cleanupset. There are two folders out of the whole directory tree that cannot be deleted at 90 days. We set up a for script with a listing of the folder names that we wanted to parse for files over 89 days.
Yesterday I noticed it was not deleting all the old data and thought one of the folders in the list may have caused it to die since there were no errors and I have an error capture in the script as well which always emailed me the results. So I reordered by list which is each directory name one per line. I took the last 10 folder names and out and added them at the top of the list.
There are no spaces in any of the lines holding the folder names.
Can you see what I did wrong please as a ton of data was deleted. Yes I had a synced server but it started replicating. Nightmare.
+++++
@echo off
set cleanupset=2009static-Xclude-JDR
set daysold=89
g:\
cd\
cd static3\imgdisk3
for %d in (@c:\robocopy\staticcleanup\%cleanupset.txt) for /[d-%daysold%,1/1/80] /h /a:d %s in (%d\*) del /s /x /y /z %s
-------
This is the 4NT command log. It starts by deleting the files over 89 days and deletes them properly and after the letter R it just starts deleting the whole folder. I moved the folders from the letter S through Z to the top of the @file list. I am thinking it has been by some odd chance that this was not always creating a problem and the reordering obviously affected it immensely.
Seems simple to delete all files and folders over 89 days old except for two folders yet clearly I no longer have a script that does that.
Folders were deleted that were not in my @file list at all.
8/30/09 16:56:02][B044] del /s /x /y /z RZOO\09-01-06_16-25-46_RZOO >>f:\utils\logs\static3\CleanUp-2009-08-30-2009static-Xclude-JDR.log
[ 8/30/09 16:56:03][B044] for /[d-%daysold%,1/1/80] /h /a:d %s in (%d\*) del /s /x /y /z %s >>f:\utils\logs\static3\CleanUp-%_isodate-%cleanupset.log
[ 8/30/09 16:56:03][B044] for /[d-%daysold%,1/1/80] /h /a:d %s in (%d\*) del /s /x /y /z %s >>f:\utils\logs\static3\CleanUp-%_isodate-%cleanupset.log
[ 8/30/09 16:56:03][B044] del /s /x /y /z \RECYCLER >>f:\utils\logs\static3\CleanUp-2009-08-30-2009static-Xclude-JDR.log
[ 8/30/09 16:56:03][B044] There are no more files.
"G:\RECYCLER\*"
[ 8/30/09 16:56:03][B044] del /s /x /y /z \Static3 >>f:\utils\logs\static3\CleanUp-2009-08-30-2009static-Xclude-JDR.log
[ 8/30/09 16:56:03][B044] There are no more files.
"G:\Static3\IMGDisk3\AVF\*"
[ 8/30/09 16:58:05][B044] There are no more files.
"G:\Static3\IMGDisk3\BNC\*"
[ 8/30/09 17:00:35][B044] There are no more files.
"G:\Static3\IMGDisk3\BZ\*"
I have been running the below script for some time. AT one time it worked perfectly deleting all data over 89 days in the folder names listed in the cleanupset. There are two folders out of the whole directory tree that cannot be deleted at 90 days. We set up a for script with a listing of the folder names that we wanted to parse for files over 89 days.
Yesterday I noticed it was not deleting all the old data and thought one of the folders in the list may have caused it to die since there were no errors and I have an error capture in the script as well which always emailed me the results. So I reordered by list which is each directory name one per line. I took the last 10 folder names and out and added them at the top of the list.
There are no spaces in any of the lines holding the folder names.
Can you see what I did wrong please as a ton of data was deleted. Yes I had a synced server but it started replicating. Nightmare.
+++++
@echo off
set cleanupset=2009static-Xclude-JDR
set daysold=89
g:\
cd\
cd static3\imgdisk3
for %d in (@c:\robocopy\staticcleanup\%cleanupset.txt) for /[d-%daysold%,1/1/80] /h /a:d %s in (%d\*) del /s /x /y /z %s
-------
This is the 4NT command log. It starts by deleting the files over 89 days and deletes them properly and after the letter R it just starts deleting the whole folder. I moved the folders from the letter S through Z to the top of the @file list. I am thinking it has been by some odd chance that this was not always creating a problem and the reordering obviously affected it immensely.
Seems simple to delete all files and folders over 89 days old except for two folders yet clearly I no longer have a script that does that.
Folders were deleted that were not in my @file list at all.
8/30/09 16:56:02][B044] del /s /x /y /z RZOO\09-01-06_16-25-46_RZOO >>f:\utils\logs\static3\CleanUp-2009-08-30-2009static-Xclude-JDR.log
[ 8/30/09 16:56:03][B044] for /[d-%daysold%,1/1/80] /h /a:d %s in (%d\*) del /s /x /y /z %s >>f:\utils\logs\static3\CleanUp-%_isodate-%cleanupset.log
[ 8/30/09 16:56:03][B044] for /[d-%daysold%,1/1/80] /h /a:d %s in (%d\*) del /s /x /y /z %s >>f:\utils\logs\static3\CleanUp-%_isodate-%cleanupset.log
[ 8/30/09 16:56:03][B044] del /s /x /y /z \RECYCLER >>f:\utils\logs\static3\CleanUp-2009-08-30-2009static-Xclude-JDR.log
[ 8/30/09 16:56:03][B044] There are no more files.
"G:\RECYCLER\*"
[ 8/30/09 16:56:03][B044] del /s /x /y /z \Static3 >>f:\utils\logs\static3\CleanUp-2009-08-30-2009static-Xclude-JDR.log
[ 8/30/09 16:56:03][B044] There are no more files.
"G:\Static3\IMGDisk3\AVF\*"
[ 8/30/09 16:58:05][B044] There are no more files.
"G:\Static3\IMGDisk3\BNC\*"
[ 8/30/09 17:00:35][B044] There are no more files.
"G:\Static3\IMGDisk3\BZ\*"