How to copy very large directory trees


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to copy very large directory trees
# 1  
Old 10-29-2012
How to copy very large directory trees

I have constant trouble with XCOPY/s for multi-gigabyte transfers.
I need a utility like XCOPY/S that remembers where it left off if I reboot. Is there such a utility? How about a free utility (free as in free beer)?

How about an md5sum sanity check too?

I posted the above query in another forum. Answers to the above question are welcome here too. My question for this forum is: How feasible is it it write a script in groovy, python, cygwin bash, Activestate perl, powershell, etc... to implement a linux "cp -R" or windows "xcopy/s" program that can continue where it left off after a reboot?

I cannot think of clever way do do this easily -- can you?

I could write it in C++ -- but I'm hoping for something more quick and elegant.


Thanks
Siegfried
# 2  
Old 10-29-2012
The rsync utility has all the features you listed as well as many more you man not have thought of.
# 3  
Old 11-12-2012
Tools How does --partial work?

How do I get the restart feature?
I tried the little script at linux - Resume rsync over SSH after broken connection? - Super User
and it seemed to work fine on a small directory.

Do I need to install the rsync deamon to have the automatic restart feature?
I think not -- but I'm not sure.

Does the --partial flag mean that if we previously rebooted in the middle of a transfer and we are executing this again, it will continue where it left off in the source directory? After reading the documentation, it does not look to me like "--partial" refers to partially copied directories but rather partially copied files.

Is there a way to tell rsync to only copy the files in the source directory that have not been correctly copied to the destination yet (because we were previously interrupted with a reboot)?

Thanks!
Siegfried
# 4  
Old 11-12-2012
Rsync will skip any files that are already in the destination by default it uses file size+date+time or with the -c option computes a checksum.

--partial saves a partially transfered file and will resume from where it was, without this, a file that is in being transfered when a server is rebooted or goes off the network will be deleted and the file re-transfered. This can be important if large files are being transfered and starting again will waste a lot of bandwidth.

--del can be important to remove files on the destination side that don't exist on the source side.

Try is something like this to copy a directory path keeping owner/permissions and removing and file in dest not in source

Code:
rsync -avc --del --partial /path/to/source/files/ dest:/path/to/dest/files

also consider something like --bwlimit=4000 to avoid swamping your network by limiting the transfer to 4Mbps.
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

ksh - Checking directory trees containing wild cards

Hi Can somebody please show me how to check from within a KSH script if a directory exists on that same host when parts of the directory tree are unknown? If these wildcard dirs were the only dirs at that level then ... RETCODE=$(ls -l /u01/app/oracle/local/*/* | grep target_dir) ... will... (4 Replies)
Discussion started by: user052009
4 Replies

2. Shell Programming and Scripting

Copy the files in directory and sub folders as it is to another directory.

How to copy files from one directory to another directory with the subfolders copied. If i have folder1/sub1/sub2/* it needs to copy files to folder2/sub1/sub2/*. I do not want to create sub folders in folder2. Can copy command create them automatically? I tried cp -a and cp -R but did... (4 Replies)
Discussion started by: santosh2626
4 Replies

3. Slackware

What is the medium usually used to backup large trees?

Hi: What's asked. (2 Replies)
Discussion started by: stf92
2 Replies

4. UNIX for Dummies Questions & Answers

Is it better/possible to pause the rsyncing of a very large directory?

Possibly a dumb question, but I'm deciding how I'm going to do this. I'm currently rsyncing a 25TB directory (with several layers of sub directories most of which have video files ranging from 500 megs to 4-5 gigs), from one NAS to another using rsync -av. By the time I need to act ~15TB should... (3 Replies)
Discussion started by: DeCoTwc
3 Replies

5. Shell Programming and Scripting

how to copy the directory but not copy certain file

Hi experts cp bin root src /mnt but not copy bin/bigfile any help? ( I post this thread in the "redhat" forum wrongly, I don't know how to withdraw that question in that wrong forum) Thanks (6 Replies)
Discussion started by: yanglei_fage
6 Replies

6. UNIX for Advanced & Expert Users

How to rsync or tar directory trees, with hidden directory, but without files?

I want to backup all the directory tress, including hidden directories, without copying any files. find . -type d gives the perfect list. When I tried tar, it won't work for me because it tars all the files. find . -type d | xargs tar -cvf a.tar So i tried rsync. On my own test box, the... (4 Replies)
Discussion started by: fld2007
4 Replies

7. Shell Programming and Scripting

Best way to diff two huge directory trees

Hi I have a job that will be running nightly incremental backsup of a large directory tree. I did the initial backup, now I want to write a script to verify that all the files were transferred correctly. I did something like this which works in principle on small trees: diff -r -q... (6 Replies)
Discussion started by: same1290
6 Replies

8. Shell Programming and Scripting

Copy large dump file

Hi Experts.. Could anyone please let me know the easier way to copy large dump of files from one server to another. I am trying to copy a set of dump files on two different servers placed in different geographic locations.. Though there are other factors such as latency, etc., slowing up the... (4 Replies)
Discussion started by: ganga.dharan
4 Replies
Login or Register to Ask a Question