![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Script to copy log files with today's date | mdncan | Shell Programming and Scripting | 3 | 12-30-2008 02:14 PM |
| Script required to copy and delete files | srnagu | Shell Programming and Scripting | 3 | 12-30-2008 02:49 AM |
| copy similar files only both at different locations using script. | fed.linuxgossip | Shell Programming and Scripting | 1 | 11-23-2007 04:02 AM |
| Urgent !!! Shell script to copy files to VSS | devalin | Shell Programming and Scripting | 1 | 08-20-2007 06:16 AM |
| copy files without password in script | jwala | Shell Programming and Scripting | 0 | 02-12-2006 01:10 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Trying to copy a TON of files with a script
Ok, here's the problem. I need to copy about 200 GB from an old FreeBSD (5.2.1) server to a new Debian server. The old server's fastest port is the ethernet port. I set up an NFS server on the new machine so I can just copy the files over using regular commands/scripts etc. Thing is, I probably shouldn't copy dozens of GB of files using the 'cp' command. The last time I tried that it crashed the server.
My plan is to write a script that will process a list of files copying each file from the list one at a time (while making a separate list of files successfully copied that way if anything goes wrong, I can difference the two lists and pick up where it left off). More importantly, I can copy all files ahead of time and then generate a smaller list of files modified since the original copy so that on migration day I have a minimal number of files to copy minimizing downtime. The main problem (that I can see) with this is, any list I generate will contain both files and folders, but the folders don't need to be copied, only recreated with identical owners and permissions. Unless there is a flag for the 'cp' command that copies a folder without it's contents (not that I know of), I need to find some other way to test each path to see what it is, then if it is a directory, somehow find the permissions and owner and duplicate it on the new server. If anyone has any advice, can see any other problems or knows of a better way I might do this, I'd appreciate the help. Thanks! |
|
||||
|
wow, that's exactly what I want. I'm always trying to reinvent the wheel it seems
I installed rsync on my Debian box (the FreeBSD already had it) and then ran this from the BSD box: rsync -r -H -p -o -g -t -v -e ssh /users4 root@myserver.domain:/ Everything seems to be working great. And I can't believe it actually compares parts of files. That will make transferring the large mail files so much easier. I'll have the server migrated in less than an hour during lunch with this tool ![]() |
|
||||
|
Yes, rsync is wonderful.
Now that you know that, take a look at Rsnapshot, which uses rsync to create backup sets. I found the docs a little confusing so I wrote Using Rsnapshot Mac OS X uses a scheme just like this for their Time Machine backups. They have a few tricks rsnapshot lacks, but the basic idea is the same and it's definitely a convenient scheme - thanks to rsync! |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|