Tar a folder via ssh problem...

Discussion in 'Site & Server Administration' started by Aceday, Sep 27, 2007.

  1. #1
    I have a huge site with a folder that contains around 40gb of files, i am moving servers so i need to put all that folder in an archive so i can hopefully just wget the archiev to the new server via ssh. But for some reason when ever the archive gets to about 4gb, it seems to start all over again, goes back to zero and continues to get to 4gb and then back to 0. Is it timing out or something?
     
    Aceday, Sep 27, 2007 IP
  2. tanfwc

    tanfwc Peon

    Messages:
    579
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #2
    since you have 40GB of data, I suggest that you use rsync instead. So that's if the connection time out, rsync will be able to pick up the last file it is been transferred over. :)
     
    tanfwc, Sep 27, 2007 IP
  3. turiel

    turiel Peon

    Messages:
    148
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #3
    As tanfwc says, rsync is your man, especially if you're having weird problems with tar (I've never ever heard of any problem with tar, so its weird).

    Here's a commandline:
    rsync -avrtz <localdir> user@remotehost:/remote/dir

    That will recursively transfer the files and compress them on the fly.
     
    turiel, Sep 27, 2007 IP
  4. toby

    toby Notable Member

    Messages:
    6,923
    Likes Received:
    269
    Best Answers:
    0
    Trophy Points:
    285
    #4
    hey, turiel, how can i use rsynce to move large host? let's say i have so many folders inside host A ?
     
    toby, Sep 27, 2007 IP
  5. turiel

    turiel Peon

    Messages:
    148
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Well, you can use wildcards like dir* or simply * for everything.

    Or, you can specify multiple directories on one line.

    eg. rsync -avrtz <localdir1> <localdir2> <localdir3> user@remotehost:/remote/dir
     
    turiel, Sep 27, 2007 IP
  6. Aceday

    Aceday Banned

    Messages:
    711
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #6
    so would this work:

     
    Aceday, Sep 27, 2007 IP
  7. turiel

    turiel Peon

    Messages:
    148
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Yes, that should work, assuming the remote host has the same user and directory structure (i.e. /home/user/public_html is there).

    To be a little more sure:
    cd /home/user/public_html
    rsync -avrtz * user@ip:/home/user/public_html

    But its pretty much the same, probably ;)
     
    turiel, Sep 27, 2007 IP
    Aceday likes this.
  8. Aceday

    Aceday Banned

    Messages:
    711
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    0
    #8
    ok great, thanks, will try!
     
    Aceday, Sep 27, 2007 IP