?
Solved

Robocopy only files changed after a certain date

Posted on 2016-08-16
5
Medium Priority
?
1,955 Views
Last Modified: 2016-08-19
Hi all,

Can anyone give me the correct syntax to robocopy data from a mounted backup from AFTER a certain date only ? i'e i only want files that have been changed after this Sunday 14th August to be copied across and there are already these files in the destination

Hope this makes sense.
0
Comment
Question by:gci_ee
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 38

Accepted Solution

by:
Geert Gruwez earned 2000 total points
ID: 41757765
use the maxage parameter

robocopy source dest *.* /maxage:2

you can get more help by use /? as parameter

robocopy /?
0
 
LVL 1

Expert Comment

by:P. Sisk
ID: 41757783
"robocopy SOURCE DESTINATION /E /MAXAGE:20160807" (NO QUOTES) will copy everything in the SOURCE path (replace SOURCE with correct path like C:\temp\SOURCE) with a modified date (not create date) of 8/7/2016 or newer and place it into a folder or folder tree in the DESTINATION path (replaced with proper path like C:\temp\DEST).

Example:
robocopy c:\temp\rcopy_source c:\temp\rcopy_dest /E /MAXAGE:20160807 will copy all files in the root of c:\temp\rcopy_source and its subfolders with a modified date of 8/7/2016 or newer and place it into a folder named c:\temp\rcopy_dest (it will create the destination folder and subfolders if they do not exist).
Note: to remove copying below the root of the source folder, remove the /E. This will create the folder structure in the destination older regardless of whether or not there are files in the tree that have to be copied.

Note: You can also just use MAXAGE:7 or something similar which will simply copy any file in the source with a modified date 7 days or newer from today.

Hope this helps.
0
 

Author Comment

by:gci_ee
ID: 41758402
Thanks P.Sisk but just to check is the date in US format as we're UK and want anything after the date of 14th August 2016 copying ?
0
 
LVL 1

Expert Comment

by:P. Sisk
ID: 41758406
date format if YYYYMMDD so your MAXAGE entry would look like this:
/MAXAGE:20160816

This will give you all files modified on or after the 16th of August, 2016.
Hope this helps.
0
 

Author Closing Comment

by:gci_ee
ID: 41762095
That worked fine thank you.
0

Featured Post

Has Powershell sent you back into the Stone Age?

If managing Active Directory using Windows Powershell® is making you feel like you stepped back in time, you are not alone.  For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous 24 VMware Articles (http://www.experts-exchange.com/ARTH_1864316.html?arthOrderBy=3&arthSort=1#arth), most featured Intermediate VMware Topics. My next series of articles concentrated on topics for the VMware Novice;   If you would…
What to do when Windows Update is not working correctly? What tools can I use to detect the cause of the malfunction problem? What does this numeric error code mean? These and other questions that you have been asking in the past are answered here (…
In this Micro Tutorial viewers will learn how they can get their files copied out from their unbootable system without need to use recovery services. As an example non-bootable Windows 2012R2 installation is used which has boot problems.
This tutorial will walk an individual through the process of installing the necessary services and then configuring a Windows Server 2012 system as an iSCSI target. To install the necessary roles, go to Server Manager, and select Add Roles and Featu…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question