Throw an E onto your /MOV

 

>From the help file:

/MOV :: MOVe files (delete from source after copying).

/MOVE :: MOVE files AND dirs (delete from source after copying).

 

From: Greg Farber [mailto:gregfar...@gmail.com] 
Sent: Thursday, January 28, 2010 1:52 PM
To: NT System Admin Issues
Subject: robocopy script - deleting aged folders

 

I have a ROBOCOPY batch file question please:

 

C:\Parcams is a directory that accumulates dated security camera
snapshots. 

The snapshots for each day are stored in a sub-directory, named after
that date, 

i.e., C:\Parcams\parcams-12-30-2009

 

I have prepared a script for purging files and folders that are greater
than "n" days old.

However, I have not quite got the script right. It successfully deletes
the files

inside the dated directories, but it leaves the empty directories
behind.

 

pic: http://screencast.com/t/OWFlYmEy

 

Here is the text of the script:

 

mkdir c:\dump

robocopy C:\PARCAMS C:\dump /E /MOV /MINAGE:60 /R:10

rmdir C:\dump /s /q 

 

Here is a screenshot of the results of the batch file:
http://screencast.com/t/ZjMyMzVjN

 

Any suggested tweaks? I'd like to have the script remove those empty
directories too.

 

Thanks!  ~Greg

 

 

 

 

~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/>  ~

Reply via email to