/MIR mirrors a directory tree. The question was how to do the equivalent
of /D in xcopy, which is:
/D:m-d-y Copies files changed on or after the specified date.
If no date is given, copies only those files whose
source time is newer than the destination time.
Chris Bodnar, MCSE
Sr. Systems Engineer
Infrastructure Service Delivery
Distributed Systems Service Delivery - Intel Services
Guardian Life Insurance Company of America
Email: [email protected]
Phone: 610-807-6459
Fax: 610-807-6003
_____
From: [email protected] [mailto:[email protected]]
Sent: Friday, January 29, 2010 10:26 AM
To: NT System Admin Issues
Subject: Re: robocopy script - deleting aged folders
Am I missing something, isn't that what /mir is supposed to do?
On Fri, Jan 29, 2010 at 10:06 AM, N Parr <[email protected]> wrote:
But I don't want to go back a specific date, I just want it to copy the
file and replace it if it's been changed.
_____
From: Christopher Bodnar [mailto:[email protected]]
Sent: Friday, January 29, 2010 8:08 AM
To: NT System Admin Issues
Subject: RE: robocopy script - deleting aged folders
/MAXAGE:n
Excludes files with a Last Modified Date older than n days or specified
date. If n is less than 1900, then n is expressed in days. Otherwise, n is
a date expressed as YYYYMMDD.
Chris Bodnar, MCSE
Sr. Systems Engineer
Infrastructure Service Delivery
Distributed Systems Service Delivery - Intel Services
Guardian Life Insurance Company of America
Email: [email protected]
Phone: 610-807-6459
Fax: 610-807-6003
_____
From: N Parr [mailto:[email protected]]
Sent: Friday, January 29, 2010 8:50 AM
To: NT System Admin Issues
Subject: RE: robocopy script - deleting aged folders
Another question about robocopy. How do you do the equivalent of and
xcopy /d in robocopy?
_____
From: Christopher Bodnar [mailto:[email protected]]
Sent: Thursday, January 28, 2010 2:00 PM
To: NT System Admin Issues
Subject: RE: robocopy script - deleting aged folders
You need /MOVE see below. /MOV only does files. /MOVE does files and
directories:
/MOV Moves files (that is, deletes source files after copying).
/MOVE Moves files and directories (that is, deletes source files and
directories after copying).
Chris Bodnar, MCSE
Sr. Systems Engineer
Infrastructure Service Delivery
Distributed Systems Service Delivery - Intel Services
Guardian Life Insurance Company of America
Email: [email protected]
Phone: 610-807-6459
Fax: 610-807-6003
_____
From: [email protected] [mailto:[email protected]]
Sent: Thursday, January 28, 2010 2: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
_____
This message, and any attachments to it, may contain information that is
privileged, confidential, and exempt from disclosure under applicable law.
If the reader of this message is not the intended recipient, you are
notified that any use, dissemination, distribution, copying, or
communication of this message is strictly prohibited. If you have received
this message in error, please notify the sender immediately by return
e-mail and delete the message and any attachments. Thank you.
_____
This message, and any attachments to it, may contain information that is
privileged, confidential, and exempt from disclosure under applicable law.
If the reader of this message is not the intended recipient, you are
notified that any use, dissemination, distribution, copying, or
communication of this message is strictly prohibited. If you have received
this message in error, please notify the sender immediately by return
e-mail and delete the message and any attachments. Thank you.
-----------------------------------------
This message, and any attachments to it, may contain information
that is privileged, confidential, and exempt from disclosure under
applicable law. If the reader of this message is not the intended
recipient, you are notified that any use, dissemination,
distribution, copying, or communication of this message is strictly
prohibited. If you have received this message in error, please
notify the sender immediately by return e-mail and delete the
message and any attachments. Thank you.
~ Finally, powerful endpoint security that ISN'T a resource hog! ~
~ <http://www.sunbeltsoftware.com/Business/VIPRE-Enterprise/> ~