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?
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?
tar -zcf /destination_dir/filename /home/account/public_html
example:
tar -zcf /home/account.tar.gz /home/account/public_html/
extraction similar
tar -zxf
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:
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.Code:/scripts/pkgacct (login name goes here)
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![]()
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
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.