[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 465
  • Last Modified:

Robocopy

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
introlux
Asked:
introlux
  • 5
  • 2
1 Solution
 
introluxAuthor Commented:
And to skip open files
0
 
introluxAuthor Commented:
also keep security/ntfs permisions
0
 
Santosh GuptaCommented:
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
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
introluxAuthor Commented:
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
 
Santosh GuptaCommented:
Hi,

please go with GUI mode of ROBOcopy and select your required options.
Microsoft-Robocopy-GUI-Users-Gui.doc
0
 
introluxAuthor Commented:
I needed this: /XO /IS /SEC /R:2 /E

All working fine now. Thanks!
0
 
introluxAuthor Commented:
/XO /IS /SEC /R:2 /E
0

Featured Post

Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now