Hi,
Our oracle backups get dumped out onto a win2k3 file server every night. A new directory with the date is created, and the backups are inside these directories. I want to remove any files and directories older than 4 days.
It seems like forfiles should be a good answer, and I am able to delete the files, but so far I'm not successful in deleting the directories.
This is what I've got that works for removing the files, the directory removal doesn't happen, and I don't get an error:
Any help is appreciated.
Thanks,
pt
putting the "new" in "newb".....
Our oracle backups get dumped out onto a win2k3 file server every night. A new directory with the date is created, and the backups are inside these directories. I want to remove any files and directories older than 4 days.
It seems like forfiles should be a good answer, and I am able to delete the files, but so far I'm not successful in deleting the directories.
This is what I've got that works for removing the files, the directory removal doesn't happen, and I don't get an error:
Code:
forfiles -p G:\CRISAPelicanDMP\BACKUPSET /S /M * /D -4 /C "cmd /c if @isdir==FALSE del @FILE /S ELSE RD @PATH /S"
Any help is appreciated.
Thanks,
pt
putting the "new" in "newb".....