The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Comand to tar and zip all folders in /home?

Discussion in 'General Discussion' started by jamison73, Jan 16, 2005.

  1. jamison73

    jamison73 Registered

    Joined:
    Apr 24, 2003
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Pensacola, FL, USA
    Hi,

    What is the command line command to create a tar.gz file for every folder in the home directory?

    I am moving from a dedicated server to a reseller account, and the reseller account does not allow me to transfer using cPanel/WHM. So I'm going to make a copy of each accounts home directory and ftp that to the new server. I guess I will also need to manually create the databases. :(

    Thanks,
    Jamie
     
  2. haze

    haze Well-Known Member

    Joined:
    Dec 21, 2001
    Messages:
    1,550
    Likes Received:
    3
    Trophy Points:
    38
    You could enable cpanel backups on your server, and then then just ftp those tar.gz files over, which might be easiest, and you can enable the option to backup mysql via that as well.

    To tar and gzip a folder, you would use:
    tar -zcvf username.tar.gz username

    The above assumes you are in the /home directory. The tar.gz file will be placed in the /home directory as well.

    To un-tar.gz:
    tar -zxvf username.tar.gz

    If you have a large number of sites, and the cpanel backup is not an option, you could hire someone to create a simple perl script for you to backup each folder in /home for you. Make sure you have the space available to do so.

    For information on what the above flags do, read the tar manual page. At shell prompt type man tar.

    in short:
    z - pass through gzip
    c - create archive
    v - verbose ( show information and errors to screen )
    f - file
    x - extract
     
    easyhoster1 likes this.
  3. jamison73

    jamison73 Registered

    Joined:
    Apr 24, 2003
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Pensacola, FL, USA
    Hi Beau,

    The perl script is what I'm looking for. I want something that will create an individual file for each of the directories under /home. I was hoping some sort of pipe command would do it.




    Jamie
     
  4. Roy@ENHOST

    Roy@ENHOST Well-Known Member

    Joined:
    Mar 5, 2002
    Messages:
    495
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Los Angeles California
Loading...

Share This Page