Forum     

Go Back   Digit Technology Discussion Forum > Community > Tutorials
Register FAQ Calendar Mark Forums Read

Tutorials This section offers tutorials and How to's on just about anything related to computers and IT. Note: All tutorials are courtesy the posters and not verified by Digit


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 10-01-2009, 05:47 PM   #1 (permalink)
"Aal Izz Well"
 
Krazzy Warrior's Avatar
 
Join Date: Apr 2008
Location: Inside ur BRaIN..!!
Posts: 1,832
Wink Robocopy - Excellent Command


Robocopy, or "Robust File Copy", is a command-line directory replication command. It was available as part of the Windows Resource Kit, and introduced as a standard feature of Windows Vista and Windows Server 2008.
Robocopy is designed for reliable mirroring of directories or directory trees. It has features to ensure all NTFS attributes and properties are copied, and includes additional restart code for network connections subject to disruption.


Features

Robocopy is notable for capabilities above and beyond the built-in Windows copy and xcopy commands, including the following:
  • Ability to tolerate network outages and resume copying where it previously left off (incomplete files are noted with a date stamp corresponding to 1980-01-01 and contain a recovery record so Robocopy knows from where to continue).
  • Ability to correctly copy attributes, owner information, alternate data streams, auditing information, and timestamps by default, without the need for numerous often forgotten command line switches.
  • Ability to correctly copy NTFS ACLs, (when /COPYALL provided), and to assert the Windows NT "backup right" (/B) so an administrator may copy an entire directory, including files denied readability to the administrator.
  • Persistence by default, with a programmable number of automatic retries if a file cannot be opened.
  • A "mirror" mode, which keeps trees in sync by optionally deleting files out of the destination that are no longer present in the source.
  • Ability to copy large numbers of files that would otherwise crash the built-in XCOPY utility.
  • A progress indicator on the command line that updates continuously.
Notably, Robocopy cannot copy open files that are in use by other users or applications. The so-called Backup mode is an administrative privilege that allows Robocopy to override permissions settings (specifically, NTFS ACLs) for the purpose of making backups. The Windows Volume Shadow Copy service is the only Windows subsystem that can copy open files while they are in use. Robocopy does not implement accessing the Volume Shadow Copy service in any way, inhibiting its usefulness as a backup utility for volumes that may be in use. However, one can use separate utilities such as VSHADOW or DISKSHADOW (included with Windows Server 2008) to create a shadow copy of a given volume with which to backup using Robocopy.
On the other hand, by design, the original Robocopy version is not able to replicate security attributes of files which have had their security permissions changed after an initial mirroring. This behavior was fixed on Robocopy versions included in Windows 2008 and Windows Vista. The downside of this approach is that it means Robocopy does not behave consistently between different platforms.

GUI front-end

Although Robocopy itself is a command-line tool, Microsoft Technet has also provided a GUI front-end. It has been developed by Derk Benisch, a systems engineer with the MSN Search group at Microsoft.[3] Robocopy GUI also includes version XP026 of Robocopy (Vista version). When downloaded from the TechNet link below, the version reported is "Microsoft Robocopy GUI 3.1.2." When this version of RoboCopy is run, it then reports on its header:
ROBOCOPY :: Robust File Copy for Windows :: Version XP026

Common usage examples

Copy directory contents recursively, all contents of foo to bar:
robocopy C:\foo C:\bar /E
Copy directory recursively (/E), and copy all file information (/COPYALL, equivalent to /COPY:DATSOU, D=Data, A=Attributes, T=Timestamps, S=Security=NTFS ACLs, O=Owner info, U=aUditing info), do not retry locked files (/R:0):
robocopy C:\foo C:\bar /COPYALL /E /R:0
Mirror foo to bar, destroying any files in bar that are not present in foo (/MIR), copy files in restartable mode (/Z) in case network connection is lost:
robocopy C:\foo \\backupserver\bar /MIR /Z

Folder copier, not file copier

The syntax of Robocopy is markedly different from that of standard copy commands, in that it only accepts the names of folders, not files, as its source and destination arguments. Names of files and wild-card designations (such as "*.*") are not acceptable as source or destination. Files may be selected or excluded using the optional filespec filtering argument. Filespecs can only refer to the filenames relative to the folders already selected for copying, and fully-qualified path names are not accepted.
For example, in order to copy the file foo.txt from directory c:\bar to c:\baz, one could use the following syntax:
robocopy c:\bar c:\baz foo.txt

Partial list of command line switches

The following is a list of the more common command line options for Robocopy:

Common options

/MIR Activates mirror mode, deleting any files in the destination that are not present in the source (equivalent to /E and /PURGE)./Z Copy files in restartable mode. "Restartable" means Robocopy should write a recovery record inside an incomplete file so if the operation is interrupted or aborted, a future run of Robocopy can resume copying where the previous one left off, instead of starting over at the beginning. This is useful for reliably copying large files or many files over an unreliable network such as a VPN or the Internet. An incomplete file has the same file size as the complete file, and is noted with a date stamp in the file system being within 24 hours of 1980-01-01 00:00./COPYALL Makes sure NTFS security information is copied. Equivalent to /COPY:DATSOU, where D=Data, A=Attributes, T=Timestamps, S=Security=NTFS ACLs, O=Owner info, U=aUditing info/B Opens files in backup mode. Backup mode allows files to be opened without security restrictions, but requires additional rights on both the source and destination systems./ZB Use restartable mode; if access denied use backup mode.
Specialized options

/S Copies subdirectories unless they are empty (like XCOPY)./E Copies subdirectories, even empty ones (like XCOPY)./M Copies only files with the Archive attribute and reset it (like XCOPY /M option)./MOV Moves the files, removing them from the source folder./MOVE Moves files AND dirs (folders) (delete from source after copying)./MON:n This will monitor and trigger a copy after n changes (and MOT minutes)./MOT:n This will set the minimum monitor interval (n minutes) before another copy is triggered./XA:attributes Excludes files with any of the given attributes set. Example: /XA:H will skip copying any hidden files./XF filespec Excludes files indicated by filespec. Wildcards are accepted. Example: /XF *.bak will skip copying any file with an extension of .bak./XD dirspec Excludes directories indicated by dirspec by name/path. Wildcards work (i.e. /XD BKUP* skips copying all directories whose name starts with "BKUP", regardless of where in the source tree they are found)./XC Exclude changed files./XN Exclude newer files./XO Exclude older files (Please note that the Robocopy GUI (3.1.1) does not use this switch correctly, meaning it still copies older files over newer ones. Version 3.1.2 corrects this problem.)/XX Exclude extra files and directories./XL Exclude lonely files and directories./IS Include same files./IT Include tweaked files (ie.: if one file has Archive attribute, while the other file has Archive and Read-only properties)./XJ Exclude junctions. When copying user accounts to another place in Windows Vista, it is important to exclude junctions. The junction in '\Users\...\AppData\Local' named 'Application Data' points to its parent folder, creating a loop which will break Robocopy. Furthermore, if a junction point is contained in a source disk which is mirrored using /MIR (or /E /PURGE) to a target disk, and a junction point from the source disk is copied to the target disk, it will "point to" your source disk, potentially resulting in modification of the contents of the source disk./R:n Tells Robocopy to retry 'n' times before giving up in the event of error (default is 1 million)./IPG:n Tells Robocopy to pause 'n' milliseconds between packets for network transfers. Useful to preserve bandwidth on slow lines./L Pretends to do the copy without actually doing it, which is useful for testing a command line without being committed to the results./W:n Wait time between retries (default is 30 seconds)./PURGE Deletes files no longer in the source location./MAXAGE:n MAXimum file AGE - exclude files older than n days/date./MINAGE:n MINimum file AGE - exclude files newer than n days/date.(If n < 1900 then n = no of days, else n = YYYYMMDD date).
Logging options

/NFL No file list – don't log file names./NDL No directory list – do not log directory names./NS No size – don't log file sizes./NC No class – don't log file classes./X Report all extra files, not just those selected./V Produce verbose output, showing skipped files./TS Include source file time stamps in the output./FP Include full pathname of files in the output./NP No progress – don't display % copied./ETA Show estimated time of arrival of copied files./LOG:file.txt Replace file.txt with the status of the run./LOG+:file.txt Append the status of the run to file.txt./TEE Output to console window, as well as the log file./NJH No job header./NJS No job summary.


Source:-http://en.wikipedia.org/wiki/Robocopy


I founded that yesterday and found of great use in practical life..Just waana share..plz comment...
__________________
http://webchat.freenode.net/?channels=krow

http://twitter.com/krazzywarrior
Krazzy Warrior is offline  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 10-01-2009, 05:55 PM   #2 (permalink)
M3TAL H3AD M3
 
skippednote's Avatar
 
Join Date: Feb 2007
Location: Highway To Hell
Posts: 1,376
Default Re: Robocopy - Excellent Command

Duh!!
__________________
I spit Rainbows.
skippednote is offline  
Old 10-01-2009, 06:33 PM   #3 (permalink)
Wahahaha~!
 
Faun's Avatar
 
Join Date: Dec 2006
Location: Pune/there
Posts: 7,686
Default Re: Robocopy - Excellent Command

who uses command line in windows...lol
__________________
Blog | Flickr | Battlelog
Spoiler:
Asus Z68 V-Pro|i5 2500k|TRUE Black|Ripjaws X|U2311H|N560GTX|D7000|XONAR STX|RE272|RE0|CC51|XE200PRO Walnut| TD II V2| Ultraphile|N5800

Mono
Faun is online now  
Old 10-01-2009, 07:37 PM   #4 (permalink)
Davislav Ivanuiz!!!
 
Kl@w-24's Avatar
 
Join Date: Apr 2004
Location: Pune
Posts: 1,396
Default Re: Robocopy - Excellent Command

'A command-line directory replication command'

Technical jargon sucks.
__________________
I was here when the forum's swear filter kept bleeping out the word 'FUNK'. :crazy::censored::eeksign:

www.abhi247.com | The Photohblog A Little Lunacy! [v3]

Flickr!
Kl@w-24 is online now  
Old 10-01-2009, 08:03 PM   #5 (permalink)
damn busy...
 
utsav's Avatar
 
Join Date: Sep 2006
Location: Jhansi/Meerut
Posts: 1,990
Default Re: Robocopy - Excellent Command

Seems am back to 1981 .

Oops I wasnt evn born then
__________________
MSI GX660 with ATI 5870 :grin: ultimate gaming lappy :grin:
Dell Studio 15(1555)
1TB+1.5TB external|N86|ZTE Blade|5230|E63|EP-630|Soundmagic PL50|Sennheiser CXL 400|Meelec M11P+
www.techjunkiez.com
utsav is offline  
Old 10-01-2009, 09:42 PM   #6 (permalink)
Banned to Spam
 
Krazy Bluez's Avatar
 
Join Date: May 2008
Location: Look below...not under pants dumbo...use a GPS
Posts: 548
Default Re: Robocopy - Excellent Command

Too G33K fo me !!!
__________________
My DeviantART page now exists !!!
Krazy-Bluez.deviantart.com

Twitter: http://twitter.com/KrazyBluez
Krazy Bluez is offline  
Old 14-01-2009, 02:42 PM   #7 (permalink)
Sami Hyypiä, LFC legend
 
Liverpool_fan's Avatar
 
Join Date: Jun 2007
Location: Нью-Дели
Posts: 2,139
Default Re: Robocopy - Excellent Command

Interesting...
__________________
Experience true education in Computer Science - http://www.udacity.com | http://www.coursera.org

Spoiler:
Read before asking / messaging any moderator for any query: FAQ + answers for new members

Read all the sticky threads before asking any type of query. Most basic questions are answered in those.
Don't use forum for chatting. Visit http://webchat.freenode.net/?channels=krow, enter nick and connect.
Liverpool_fan is online now  
Old 14-01-2009, 03:58 PM   #8 (permalink)
.
 
JojoTheDragon's Avatar
 
Join Date: Aug 2008
Location: Guwahati
Posts: 2,485
Default Re: Robocopy - Excellent Command

__________________
| Steam: jojothedragon | Origin : jojothedragon | PSN : jojothedragon |


TDF @ Steam
Get 2GB of free cloud space : http://db.tt/OJKPcZnY
JojoTheDragon is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
COMMAND & CONQUER UPDATE - EA shoots out Command & Conquer 3 demo techtronic Gamerz 1 28-02-2007 12:18 PM
An excellent collection of live CDs subratabera Open Source 5 21-02-2007 12:27 AM
i liked this excellent tutorials site. anandk Tutorials 9 06-05-2006 01:40 PM
Flock 0.5.11 released (excellent updates.....) LegendKiller Technology News 8 22-02-2006 04:17 PM

 
Latest Threads
- by Tenida
- by chris
- by Who
- by abhidev
- by clmlbx

Advertisement




All times are GMT +5.5. The time now is 10:57 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2