Tag Info

Hot answers tagged

30

See Robocopy /? Usage : ROBOCOPY source destination [file [file]...] [options] robocopy c:\folder d:\folder transfer_this.txt


10

Take a look at the options for the /COPY:[copyflags] and /DCOPY switches. As per the ROBOCOPY /? usage info: /COPY:copyflag[s] :: what to COPY for files (default is /COPY:DAT). (copyflags : D=Data, A=Attributes, T=Timestamps). (S=Security=NTFS ACLs, O=Owner info, U=aUditing info). /DCOPY:T :: COPY Directory ...


9

You must include the full path (including the drive) to the file to exclude. Relative paths won't work. This works: robocopy folder1 destination /E /XF "c:\somedir\another dir\folder1\help.txt" This doesn't: robocopy folder1 destination /E /XF "folder1\help.txt" Nor does this: robocopy folder1 destination /E /XF ".\folder1\help.txt"


8

Any command-line utility can be made completely silent by redirecting stdout and stderr to the special file 'nul'. This is Windows' equivalent to /dev/null on *nix systems. command >nul (stdout is not echoed) command 2>nul (stderr is not echoed) command >nul 2>&1 (neither stdout nor stderr is echoed) The latter is the one you want to ...


8

Populating strings into parameters for external commands from within Powershell requires some hoop jumping if you want to be able to use variable expansion and also have the resulting command line properly understand which parameters you want to be separated and which should not. In your example you are sending the entire string as the first parameter and ...


7

Set your expectations low. If anything robocopy then copied was written over the 'deleted' data, you will lose it. I've never used the software you mention but I have done a small amount of recovery and the best tools I found were often designed towards certain formats. For example 'photorec' was great when I wanted to get tens of thousands of jpegs ...


7

I've performed file-level clones (using the Linux NTFS Tools ntfsclone utility) of Windows 2000 and Windows XP. I haven't tried ntfsclone with Windows Vista or newer versions but I wouldn't expect any problems. I use Microsoft's file-level cloning tool, ImageX, quite regularly with Windows XP and Windows 7 and have no problems there, either. I generally ...


6

Have you tried using the /R and /W switches? Something like: /R:2 /W:2 This means retry twice wait 2 secs to retry. If the file is still open after the two attempts, the file will be skipped. Depending on your needs you could lower it to /R:1 /W:1.


6

I have been trying to do the same from a network share. SET MoveDirSource=\\Server\Folder SET MoveDirDestination=Z:\Folder Here are my findings and solution from tests on a Windows 7 machine. Suggestion: ROBOCOPY "%MoveDirSource%" "%MoveDirDestination%" /MOVE /E Problem: Moves source folder. Suggestion: ROBOCOPY "%MoveDirSource%" ...


6

Is there some reason you are not providing a UNC to robocopy? I find that using a UNC is much more reliable then depending on a mapped drive in a scheduled task.


6

A simple solution might be to use something like disk2vhd. This will create a VHD file, which a drive image format that is compatible with Hyper-V, and can also be directly mounted on Windows 7/2008 R2 and above. VHD files can also be converted so you could boot into a VM compatible with Vmware hypervisors, Virtual box and other popular visualization ...


5

Have you tried the /MOV option? /MOV :: MOVe files (delete from source after copying). F:>robocopy /? ROBOCOPY :: Robust File Copy for Windows Started : Fri Aug 06 11:51:26 2010 Usage :: ROBOCOPY source destination [file [file]...] [options] source :: Source Directory (drive:\path or \\server\share\path). ...


5

Whether it's RoboCopy or some other method, I prefer to log all output and then post-process the log. I personally prefer Perl for that task but use whatever you're comfortable with. I aslo like to have the test checking script email me the results, showing just whether it succeeded or in the case of a failure the relevant lines from the log. In my opinion, ...


4

To perform a mirror while ignoring certain file exentions, try this: robocopy c:\temp\source c:\temp\dest /e /purge /xf *.hg I tested it a bit here and it appears to leave the .hg files alone on the destination I also recommend the /z flag (restartable for large files) and have had to resort to the /fft flag in the past when dealing with servers having ...


4

In general, the BEGIN BACKUP / END BACKUP block would signal Exchange to truncate the logs. But in order for it to work, you should have created a snapshot of all volumes with Exchange-related data - so if you have separated data and transaction logs, you would need to snapshot both - the data and the Tlog volume. Also, you should make sure that your script ...


4

Excluding subfolders is actually the default behavior of robocopy, or at least the version that comes with Windows 7. (In order to copy the sub-directories you would have to add the /S or /E option to the command.) So, you can just use robocopy source-folder target-folder.


4

No, this isn't possible using Robocopy. Mirroring a folder path using Robocopy will delete files in the destination if they no longer exist in the source. You can ensure that you don't overwrite files with older versions but you can't retain older versions / rename during the copy process. I wrote a command script / batch file that copies modified files, ...


4

If that is the command line you're using then your problem is most likely the /MT 50. I suspect you meant /MT:50 to have 50 threads rather than files called 50.


4

The problem with copying a live filesystem from VSS is that that the existing Windows instance will probably have the signature of the new disk already in it's registry. When you boot the copy, the signature of the partition it is booting from is matched to the registry and mounted as D: or E:, rather than the C: it should be. You can sort this out by ...


4

These switches worked for me: /NFL : No File List - don't log file names. /NDL : No Directory List - don't log directory names. /NJH : No Job Header. /NJS : No Job Summary.'


4

The version of robocopy that is included with Server 2008 does not include the security attributes when you use the /MIR option. You have one of two options: Install the version from the Server 2003 Resource Kit (http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=17657) and command you already have. Run the command you already have and ...


4

I don't know how to do it with robocopy, but when I wanted to do the same as what you're doing, I put this line in my batch file: forfiles -p %_BACKUPPATH% -m *.rar -d -3 -c "cmd /c del @path" A dissection is: forfiles - The program for filtering the files -p %_BACKUPPATH% - -p indicates "path" (mine is %_BACKUPPATH% but you can replace this with a ...


4

You can do this by creating a placeholder file in the directory you don't want to delete, and then instructing robocopy to exclude the file using /XF Since the file is excluded, it won't get moved, and the directory won't get deleted. For details, see that other site: http://www.experts-exchange.com/OS/Microsoft_Operating_Systems/Windows/XP/Q_24306678.html ...


4

I use rsync for Windows to copy over broadband connection. It is supposedly a delta copy system which only copies over the changes of each file whereas robocopy copies over the whole file if it has changed one bit. (tbh I wonder sometimes whether it actually does this) You could also use robocopy /mon:x switch and have it permanently running. This will run ...


4

Instead of using a mapped drive letter, use the UNC path of the share (\\servername\sharename\folder). That'll simplify things since your mapped drives are associated with your session, not necessarily the session that the scheduled task runs in. Next, ensure that the user associated with the scheduled task has access to that share. That should get you ...


4

The /MOV option is designed to do exactly that. Check your specific version of robocopy for it (robocopy /? should show the option).


4

Check out RichCopy. From the web site: RichCopy is a free utility that comes to us from Ken Tamaru of Microsoft. The tool was first developed in 2001 and has been updated regularly to keep pace with evolving needs. Trust me when I tell you, this is the answer to all your file copying needs. What you'll find most striking the first time ...


4

I used Robocopy to synchronize website content across 9 web servers. Here's a sample of the batch file that ran robocopy.exe. This batch file was scheduled to run every 5 or 10 minutes or could be run manually to push changes immediately. robocopy.exe d:\inetpub\wwwroot\ \\webserver1\d$\inetpub\wwwroot\ *.* /E /PURGE /SEC /NP /NJH /NJS /XF keepalive_*.* ...


4

One mildly crazy-seeming option would be to boot up a Linux live disk and use dd to make a bit-for-bit copy of the entire drive. Basically: Make Linux live disk (CD or USB key) Boot from it Attach the external USB drive (must be same size or larger than system drive) Figure out which device is the original system drive and which is the USB drive. Run ...



Only top voted, non community-wiki answers of a minimum length are eligible