Results 1 to 7 of 7
  1. #1
    Joined
    Dec 2003
    Location
    Orlando, FL
    Age
    35
    Posts
    3,062

    RYSNC Is Not Adding Up (RHEL4)

    Guys...

    I am trying to mirror two servers together as some of you already know from previous help threads I have posted. Now that I successfully used tar and ssh to migrate all my bulk data from "LT2FS1" > "LT2FS0", I am trying to keep LT2FS0 mirrored with LT2FS1.

    So here is the command I ran. Now keep in mind that my main goal is to copy and changes made LT2FS1 over to LT2FS0 which includes files that have been deleted.

    The following command is being ran from LT2FS0 so it mirrors LT2FS1

    Code:
    rsync -avz --delete -e ssh root@10.1.1.24:/share/ctia /share/
    Now when it is complete, I do a df -h and review the data on /share and look at the difference...

    LT2FS0


    Code:
    /dev/sdc1             670G  237G  400G  38% /share
    LT2FS1

    Code:
    /dev/sdb2             304G  236G   52G  83% /share



    Code:
    rsync -avz --delete -e ssh root@10.1.1.24:/share/ctia /share/
    Now to make sure this is working correctly including the --delete, I added some folders on LT2FS0 that did not exist on LT2FS1 and after the RSYNC was done the folders were no longer there. So this tells me that this is working.

    Any reason for the extra GB in disk size?
    ./

  2. #2
    Joined
    Jul 2001
    Location
    UK
    Age
    46
    Posts
    20,230

    Re: RYSNC Is Not Adding Up (RHEL4)

    Don't know. Did you try listing the contents and diffing them? For example,

    Code:
    ls -aR > list1
    and repeat on the second machine, then diff them:

    Code:
    diff list1 list2 > list-diff
    list-diff will tell you the differences between the two servers.

    ~ Want to try Linux - check out the PC Perspective Linux FAQ ~
    ~ Please take some time to read the Forum Rules ~
    ~ Feed the spamb0tz, don't mail me here: B7Trz4568254@nirvana.admins.ws ~


  3. #3
    Joined
    Dec 2003
    Location
    Orlando, FL
    Age
    35
    Posts
    3,062

    Re: RYSNC Is Not Adding Up (RHEL4)

    Thanks for that interesting suggestion Ned.

    BTW - How does my RYSNC command look? No sure if that is right?
    ./

  4. #4
    Joined
    Jul 2001
    Location
    UK
    Age
    46
    Posts
    20,230

    Re: RYSNC Is Not Adding Up (RHEL4)

    Looks OK to me, except I'm not sure you need the trailing slash on the destination directory (just /share should do it). You need to be careful with trailing slashes in rsync, particularly on the source. For example,

    rsync -avz --delete -e ssh root@10.1.1.24:/share/ctia /share

    should copy the /share/ctia directory to /share, giving /share/ctia/my_files on the destination, whereas

    rsync -avz --delete -e ssh root@10.1.1.24:/share/ctia/ /share

    will copy the contents of the /share/ctia directory to /share, giving /share/my_files on the destination.

    SSH login as root is also a no-no. Better to login as a regular user that has the required file permissions to copy the files. If you don't have the required permissions, create a user specifically for the task that does.

    ~ Want to try Linux - check out the PC Perspective Linux FAQ ~
    ~ Please take some time to read the Forum Rules ~
    ~ Feed the spamb0tz, don't mail me here: B7Trz4568254@nirvana.admins.ws ~


  5. #5
    Joined
    Dec 2003
    Location
    Orlando, FL
    Age
    35
    Posts
    3,062

    Re: RYSNC Is Not Adding Up (RHEL4)

    Thanks for the tips. I am running an RYSNC now as you suggested and the doing a diff.
    ./

  6. #6
    Joined
    Dec 2003
    Location
    Orlando, FL
    Age
    35
    Posts
    3,062

    Re: RYSNC Is Not Adding Up (RHEL4)

    Thanks Ned. Everything looks great and the diff was super cool!
    ./

  7. #7
    Joined
    Jul 2001
    Location
    UK
    Age
    46
    Posts
    20,230

    Re: RYSNC Is Not Adding Up (RHEL4)

    Quote Originally Posted by Carlwill View Post
    Thanks Ned. Everything looks great and the diff was super cool!
    Glad you liked it. Diffing two text files and redirecting the output to a third is a very useful technique that has loads of uses

    Rsync is about the most efficient way I know of shifting files from one place to another. I can get around 10MB/sec (80mbit) over a 100mbit connection - not bad at all! Samba gives me about 8MB/sec at most and that's on a good day and not always sustained - also pretty good. In contrast, regular sftp (over ssh) caps out at about 1.3MB/sec - I'm sure there must be a bug or something

    ~ Want to try Linux - check out the PC Perspective Linux FAQ ~
    ~ Please take some time to read the Forum Rules ~
    ~ Feed the spamb0tz, don't mail me here: B7Trz4568254@nirvana.admins.ws ~


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •