Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
Operating System - Microsoft
cancel
Showing results for 
Search instead for 
Did you mean: 

Copy only new Windows files to Sama Share

SOLVED
Go to solution
Darren Etheridge_2
Super Advisor

Copy only new Windows files to Sama Share

I have been trying to set up a script that only copies new SQL BAK files to a samba share on my HPUX machine, using the following:


robocopy "F:/SQL BACKUP" \\192.168.1.7\syncback\clerkor *.bak /XO /S

I run the script and it runs fine, but the next time it is run, it copies ALL the files in the Source Directory. Nothing has changed in the files but it seems to see them as changed or new files. How can I get Robocopy to ONLY copy new or changed files; or is it a setting in SAMBA that I need to change to allow the files to have some attribute set?

Darren
3 REPLIES
Jon Finley
Honored Contributor
Solution

Re: Copy only new Windows files to Sama Share

I think what you want, rather than the /XO is to use the /M option.

/M :: copy only files with the Archive attribute and reset it.

robocopy "F:/SQL BACKUP" \\192.168.1.7\syncback\clerkor *.bak /M /S


Jon
"Do or do not. There is no try!" - Yoda
Darren Etheridge_2
Super Advisor

Re: Copy only new Windows files to Sama Share

That one works great... now I have one more problem... the batch file runs fine from the command line, but when I try to schedule it in Windows 2008 Task manager I get the following error:

2010/11/01 14:28:19 ERROR 67 (0x00000043) Creating Destination Directory \\192.168.1.7\syncback\clerkor\
The network name cannot be found.

The path is there and it works from the command line.. so what gives?

THanks!

D
Darren Etheridge_2
Super Advisor

Re: Copy only new Windows files to Sama Share

Thanks for all of your help