Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Apr 2003
    Location
    Pensacola, FL, USA
    Posts
    3

    Question Comand to tar and zip all folders in /home?

    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. #2
    Member
    Join Date
    Dec 2001
    Posts
    1,558

    Default

    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
    Beau Henderson

  3. #3
    Registered User
    Join Date
    Apr 2003
    Location
    Pensacola, FL, USA
    Posts
    3

    Default

    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. #4
    Member Roy@ENHOST's Avatar
    Join Date
    Mar 2002
    Location
    Los Angeles California
    Posts
    495
    = = = = = = = = = = = = = = = = = =
    Cpanel XP Evolution (Add DOZENS of functions to your Cpanel NOW!!!) - 21 Languages, User Friendly Interface, Feature Enabled, Highly Customizable, Create Popup Once window, Language Aware, Flash Tutorials, Theme Changer,Integration with Modernbill,WHM AutoPilot,ClientExec,LPanel&WHOISCart

Similar Threads & Tags
Similar threads

  1. Allow zip/tar in File Manager only if data is less than a config value
    By panayot in forum Feature Requests for cPanel/WHM
    Replies: 0
    Last Post: 01-12-2010, 01:12 AM
  2. How can i make tar file for mulitiple folders
    By rajesh_ in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 10-16-2006, 09:28 AM
  3. FTP accout in comand [moved]
    By online_kn in forum New User Questions
    Replies: 1
    Last Post: 10-16-2005, 01:52 AM
  4. SP2 Backups tar.tar or tar.gz
    By JudgeJeffries in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 09-19-2004, 05:20 PM
  5. After SSl instal WHM wont restart apache but comand line wil
    By JeremyL in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 10-29-2001, 01:23 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube