This means that file data (and the missing subfolders) subsequently copied into place with /nosec would be forced to inherit the parent permissions. In practice I found emcopy to be inconsistent with copying ACE’s across to large filesystems, completely skipping some folders when creating an empty folder structure using the /xf * /create method.
Just type robocopy /? from the Windows command line to see the other options. There are many more switches available in robocopy, including the ability to use multiple threads in newer versions (highly recommended). Robocopy d:\source e:\dest *.* /xd “System Volume Information” d:\Migration homedirs profiles wtsprofiles /e /np /fft /xo /r:1 /w:1 In practice, this brought down troublesome 36 hour copy operations requiring a weekend cut-over to be arranged, down to just over 1 hour – cue cliche – saving time and money. This means that subsequent copies of the changed files take just as long as the initial copy.īy appending /FFT to the long list of switches used in your robocopy command, it allows for a discrepancy of up to 2 seconds – enough to provide a convenient workaround to this problem. When migrating data into a Celerra/VNX/NetApp CIFS Server, the act of copying data from a NTFS volume on a Windows Server to a Linux based Filesystem on a NAS is enough to throw the timestamps on the files out just enough to make robocopy think that the source file is newer, even when it’s not. Note: Use /TIMFIX with /B to correct non-copying of datestamps on files, resulting in datestamps on all files copied with /B Backup rights. Uh, and come to think of it, the /XO switch too (especially if you’re running a repeated backup of data to a USB HDD). Update: AND THE /B SWITCH (use backup rights). The switch worth mentioning the most though, is the /FFT switch.
Robocopy on the other hand, does allow exclusion of more than one directory, each one specified using the /xd switch and can be a full path (to exclude very specific directories) or just one word (to exclude any directories with that name anywhere in the directory tree). This has mainly come about having discovered an annoying bug in emcopy whereby it doesn’t ignore the directories specified by more than one /xd exclusion – it always excludes the last one specified, but none of the others?! I thought it only fair to follow up with an equivalent post for good ol’ robocopy. To simply find zero-byte files and append their full pathnames to a logfile, useįor /r %F in (*) do if %~zF=0 echo “%F” > e:\logs\zerobytefiles.logĪs a compliment to my recent post “Data Migration using emcopy” Note: to set your source and destination paths in a batch file, use the following syntax This will remove the zero-byte files, allowing you to subsequently re-copy the now missing files from the source If you wish to include the command in a batch file, you’ll need to double up on the % characters,įor /r %%F in (*) do if %%~zF=0 del “%%F”
To recursively delete zero-byte files in your folder structure, use the following command The best solution I’ve found is to identify and delete any files that are zero-bytes in length before re-running another copy. Since the zero-byte files will have a newer time stamp than the source data, they become impossible to “fix” without potentially affecting surrounding files. The problems come when you re-run the copy in the hope that the zero-byte files in the destination folder structure are updated with healthy ones from the source. A common problem with data migration at the file level is that you can end up with users complaining of zero-length files.