Solved

Robocopy

Posted on 2014-03-31
7
454 Views
Last Modified: 2014-03-31
Hi,

Looking for a command to do the following:

COPY FILE AND FOLDER THAT ARE:

Copy/overwrite same file with the exclusion if the file is newer/modified

I have the following script:

robocopy "\\Oldlocation\Files" "\\NewLocation\Files" /XN /XC /IS

Does not seem to keep the newer file, it overwrites it.

Any help will be appreciated.

Regards,

introlux
0
Comment
Question by:introlux
  • 5
  • 2
7 Comments
 

Author Comment

by:introlux
Comment Utility
And to skip open files
0
 

Author Comment

by:introlux
Comment Utility
also keep security/ntfs permisions
0
 
LVL 13

Accepted Solution

by:
Santosh Gupta earned 500 total points
Comment Utility
Hi,

/XN mean " Excludes newer files."

and use /R:2 so that any open files will be skipped after 2 attempts.

/sec

for security

so final command will looks like

robocopy "\\Oldlocation\Files" "\\NewLocation\Files"  /XC /IS /SEC /R:2
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

Author Comment

by:introlux
Comment Utility
This does not work. anything that is modified also needs to be skipped. This is basically new files or existing files with a newer modified timestamp.
0
 
LVL 13

Expert Comment

by:Santosh Gupta
Comment Utility
Hi,

please go with GUI mode of ROBOcopy and select your required options.
Microsoft-Robocopy-GUI-Users-Gui.doc
0
 

Author Comment

by:introlux
Comment Utility
I needed this: /XO /IS /SEC /R:2 /E

All working fine now. Thanks!
0
 

Author Closing Comment

by:introlux
Comment Utility
/XO /IS /SEC /R:2 /E
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Are you looking to recover an email message or a contact you just deleted mistakenly? Or you are searching for a contact that you erased from your MS Outlook ‘Contacts’ folder and now realized that it was important.
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
This tutorial will show how to push an installation of Backup Exec to an additional server in both 2012 and 2014 versions of the software. Click on the Backup Exec button in the upper left corner. From here, select Installation and Licensing, then I…
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…

763 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now