Operating System - Microsoft
1752802 Members
5726 Online
108789 Solutions
New Discussion юеВ

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 3
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