![]() The resulting log file name will look like: Log File Name_2014_05_30_16_06_33.txt Use the underscore if you need spaces for readability. I have also found that having spaces in the log file name will jam it up. The underscore between the log file name and DateSeed variable is for readability of the logfile name. ![]() ROBOCOPY %SORC% %DEST% /MIR /SEC /R:1 /W:1 /NP /LOG:%LOG% /NFL errorlevel 16 echo ***ERROR *** & goto errorlevel 8 echo **FAILED COPY ** & goto errorlevel 4 echo *MISMATCHES * & goto errorlevel 2 echo EXTRA FILES & goto errorlevel 1 echo -Copy Successful- & goto errorlevel 0 echo -Copy Successful- & goto END SET LOG="Z:\THE_LOG_FILE_NAME_%dateseed%.txt" I tweaked this slightly to include Date/Time in the log file name and added the /NFL /NDL so as to not include every file/folder copied in the log, just any that have errors, for those who want this functionality: ROBOCOPY %SORC% %DEST% /MIR /SEC /R:1 /W:1 /NP errorlevel 16 echo ***ERROR *** & goto errorlevel 8 echo **FAILED COPY ** & goto errorlevel 4 echo *MISMATCHES * & goto errorlevel 2 echo EXTRA FILES & goto errorlevel 1 echo -Copy Successful- & goto errorlevel 0 echo -Copy Successful- & goto END Here's a decent comparison of 15 different tools, with a focus on speed, but I'm sure there are several in there that will retain all the NTFS permissions, timestamps, ownership, etc. Many of them don't even have to be installed and are every bit as powerful as robocopy. For the big one off copy job, find yourself a nice GUI based utility. Still, it's better than nothing.įYI - For non scripted / scheduled backup copy jobs, robocopy is not ideal. There are several "how to" guides online detailing how to "backup share permissions" by exporting the relevant registry keys, then importing them into another server, but most fail to mention that for that to work the new server has to be essentially identical to the old in terms of where the files are and what partitions they live on. You say all the data is under a single root directory so I'll assum that means you only have a single - I believe the share permissions aren't tied to the files / folders themselves, they're kinda stored in the registry, so most file copy utilities can't get those. LOG:file :: output status to LOG file (overwrite existing log). TEE :: output to console window, as well as the log file. ![]() V :: produce Verbose output, showing skipped files. W:n :: Wait time between retries: default is 30 seconds but I set this to 1 second. R:n :: number of Retries on failed copies: default is 1 million but I set this to only retry once. Copies the Data, Attributes, Timestamps, Ownser, Permissions and Auditing info COPYALL :: COPY ALL file info (equivalent to /COPY:DATSOU). ZB :: use restartable mode if access denied use Backup mode. E :: copy subdirectories, including Empty ones. Source :: Source Directory (drive:\path or \\server\share\path).ĭestination :: Destination Dir (drive:\path or \\server\share\path). Robocopy source destination /E /ZB /DCOPY:T /COPYALL /R:1 /W:1 /V /TEE /LOG:Robocopy.log It took me a lot of hours already without any difference.Here's the command I typically use when I want to retain all permisions, ownership and timestamps of the entire folder structure and data: It seems that FreeFileSync does not have the correct permissions, but I don't find a way to change it. When I do it manually (copy/paste files and folders to mounted folder) everything works fine. If followed the instructions as described here.īUT in all cases I get the following error code in FreeFileSync for the files to be transfered to the NAS: errorcode 13: Permission denied I've uses several mounting options, as with or without umask=0222,file_mode=0777,dir_mode=0777 I have mounted my shared folder with following line in /etc/fstab It works perfect between folders on my laptop and from NAS to laptop. I'm trying to figure out how to get my laptop synced with my (Synology) NAS. I'm new in linux so forgive me if I make obvious mistakes.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |