Coders Tent

Syed Ashik Mahmud - Pro System Admin and Malware Cleaner

Category: SSH

How to Backup and Restore cPanel Accounts via SSH

Scala Hosting

Creating a cPanel Backup via SSH

To create a backup of your individual cPanel account using SSH, just follow these steps:

  1. First, log in to SSH as the Root user.
  2. Next, enter the following command string on the command line interface:

    /scripts/pkgacct username

  3. A backup of your account will be created and stored in the directory you are currently in.

 

Restoring a cPanel Backup via SSH

To restore a previously created backup of your cPanel account, just follow these steps:

  1. First, if you haven’t already, log in to SSH as the Root user.
  2. Navigate to the directory containing your backup file. *Note: In order to restore your data, you must be in the correct directory.
  3. Next, to restore your cPanel backup, enter the following command into the command line:

    /scripts/restorepkg username

And there you have it!

Finding which hosting account/reseller a domain belongs by ssh

Scala Hosting

You can find the account ownership of a domain name with a command such as:

Code:

/scripts/whoowns $domain

Or via:

Code:

grep $domain /etc/userdomains

You can then search for the username in /etc/trueuserowners to see which reseller owns the account. EX:

Code:

grep $username /etc/trueuserowners

Thank you.

How to zip a folder via SSH Terminal

Scala Hosting

zip -r filename.zip foldername/

This is how you can zip a folder via SSH on your Linux server. Works on Debian and other servers.