Jump to content

Recommended Posts

Guest Zak Lyles
Posted

We recently had the need to replicate data from multiple windows servers to a FAT based Linux share. I just wanted to share the script with everybody in case anybody else runs into similar issues.

 

The script assumes NTFS security is not needed on these files.

 

One issue I ran into when copying files to the FAT share was that MANY files were giving an "error 5: Access is denied" message and failing to copy.

 

By setting the copy method to "/COPY:DT", attribute copying is removed from the process and all files(aside from files with read-locks) copy successfully.

 

Additionally, the /FFT(assume FAT file times) option is important when copying from NTFS to FAT.

 

At the end of the day I had this simple batch file(modified from http://ss64.com/nt/robocopy.html) which I run on the servers I want data backed up from:

 

--------------------------------------------------------------------------------------------------------------------------------------------------------

 

@ECHO OFF

 

SETLOCAL

 

SET _source1="Source(local or UNC)"

 

SET _dest1="\\server\share_name\destination_folder"

 

SET _what=/COPY:DT /MIR

 

SET _options=/R:0 /W:0 /FFT /XF thumbs.db /LOG+:"\\log_destination\name.txt" /NFL /NDL

 

ROBOCOPY %_source1% %_dest1% %_what% %_options%

 

--------------------------------------------------------------------------------------------------------------------------------------------------------

 

This script will perform the following:

 

1. Mirror source to destination

 

2. Ignore attributes and security

 

3. Use FAT file times

 

4. Will not retry files it is unable to access

 

5. Will not copy any files with the name thumbs.db.

 

6. Will create a log file which only logs failures and files deleted from destination due to /PURGE(from the /MIR option).

 

Hopefully this will come in handy for a few folks out there.

 

Zak

 

More...

  • Replies 0
  • Created
  • Last Reply

Popular Days

Popular Days

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...