Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Results 1 to 5 of 5
  1. #1
    Member
    Join Date
    Jun 2006
    Posts
    146

    Default how to backup the home directory using ssh?

    I know i can back up the home directory of one account in cPanel, but is there a script like pkgacct that will backup only the home directory?

  2. #2
    Member
    Join Date
    Nov 2003
    Posts
    16

    Default

    tar -zcf /destination_dir/filename /home/account/public_html
    example:
    tar -zcf /home/account.tar.gz /home/account/public_html/

    extraction similar
    tar -zxf

  3. #3
    BANNED
    Join Date
    Jun 2005
    Location
    Wild Wild West
    Posts
    2,025

    Lightbulb

    If you change the "z" to a "j" in sfgriffin's suggestion, you can use ".tar.bz2" for the archive which get's much tighter compression.

    Now if you are just wanting to archive the folder then creating an archive may work for you but Cpanel also has a few good scripts for this too:

    Code:
    /scripts/pkgacct  (login name goes here)
    This will make a complete backup of the entire account and drop the backup file in your /home folder on the server's hard drive.

    Filename: cpmove-(login).tar.gz

    With that file, you can re-create the entire account on any Cpanel server
    or restore it again on the same server should disaster strike

  4. #4
    Member
    Join Date
    Jan 2005
    Location
    Earth
    Posts
    1,050

    Default

    Quote Originally Posted by sharmaine001 View Post
    I know i can back up the home directory of one account in cPanel, but is there a script like pkgacct that will backup only the home directory?
    You can backup the home directories of all the accounts in a one go using the following command:

    for i in `cat /etc/trueuserdomains | awk '{print $2}'`; do tar -zcf /home/backup/$i.tar.gz /home/$i; done;

    but before executing the above command, create the backup directory under /home

    mkdir /home/backup

  5. #5
    Member
    Join Date
    Jun 2008
    Posts
    32

    Default

    You can also create a simple script using the API to just perform the home directory backup. Then run this script on your daily cron.

Similar Threads & Tags
Similar threads

  1. Home Directory Backup
    By worldcom in forum cPanel and WHM Discussions
    Replies: 6
    Last Post: 02-28-2007, 04:27 PM
  2. Home Directory Backup Bug
    By tvp in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 10-12-2005, 11:48 AM
  3. Cpanel Full Backup and Home Directory backup
    By strikinado in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 07-29-2005, 12:36 PM
  4. Any Way to Jail SSH Users to their Home Directory?
    By Jeff75 in forum cPanel and WHM Discussions
    Replies: 7
    Last Post: 11-08-2004, 05:16 PM
  5. Chrooting users to their home directory SSH
    By ozzi4648 in forum cPanel and WHM Discussions
    Replies: 9
    Last Post: 12-21-2002, 08:44 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube