In this guide, I will be setting JetBackup5 on a new server, with a remote (SSH) destination, and scheduling daily cPanel backups.
The following should be already created:
- JetBackup5 license is activated for the server IP
- SSH account created on the remote destination server
Install JetBackup5
Enable the JetApps repository:
bash <(curl -LSs http://repo.jetlicense.com/static/install)
Install JetBackup 5 on cPanel server:
jetapps --install jetbackup5-cpanel stable
Navigate to WHM > JetBackup5 and accept the license:
Select New installation, then OK, and finally Finish button.
Enable SSH plugin
In JetBackup5 you need first to install a plugin to use SSH as remote destination.
From WHM > JetBackup >Plugins click on Available plugins.
Find the SSL plugin and click on Install, then OK
then on Enable plugin.
Now that the SSH plugin is active, We can add our destination server.
Create a new SSH destination
From JetBackup click on Destinations and Create a New Destination.
Set destination type to SSH
Fill in the server name:
If you will be storing backups on this remote server from multiple servers, set also the directory:
Then fill in the SSH login details:
I recommend creating a new SSH user that will be used exclusively for backups. Also for authentication, I recommend using a private key.
Save the settings and the new destination will be validated:
Create a new Backup job
After the destination is added, We can create a new backup job to enable automatic backups.
Create a new Backup Job and set the following:
- Name for the destination
- Destination: Newly created SSH remote destination
Create a new Account filter to exclude suspended accounts:
I also recommend excluding archives, cache, and backup directories:
Click on Insert Multiple and just paste these files:
/tmp/*
/.cpanel/*
*/error_log*
/public_ftp/*
*/*.log*
backup-*.tar.gz
cpmove-*.tar.gz
site-*.tar.gz
public_html/cache/*
softaculous_backups/*
*/wp-content/cache/*
/wp-content/backups/*
/wp-content/updraft/*
/wp-content/ai1wm-backups/*
and set the Schedule, in this example, I will set the backups to run daily and save up to 8 backups for each account.
Additional Recommended Jetbackup5 settings
Here are a few recommended JetBackup5 settings:
Change JetbaCkup5 folders
I recommend changing the JetBackup5 Workspace and Downloads directories (that jb5 uses to download and create backups) to something other than /usr – in most cases you should use /home
First copy the current folders:
cp -a /usr/local/jetapps/usr/jetbackup/workspace /home/backupjb
cp -a /usr/local/jetapps/usr/jetbackup/downloads /home/downloadjb
Then navigate to Settings > General and change them both:
to
then save the settings.
Limit CPU and IO usage
It is possible that Jetbackup uses all available resources if not limited, so make sure to limit CPU and IO usage accordingly to your server hardware:
Change Postgre Configuration
To avoid errors when backing up postgre databases, you should change the default pg_hba.conf file:
nano /var/lib/pgsql/data/pg_hba.conf
and change
host samerole all ::1/128 md5
to
host all all ::1/128 md5
Save, then restart Postgres and JetBackup:
service postgresql restart
service jetbackup5d restart