Last modified November 7, 2024

Command Line Tools

Learn about various command line tools that allows JetBackup to execute additional tasks.

JetBackup 5 API commands

To utilize the JetBackup 5 via CLI, please refer to our documentation here. Our API allows you to execute many tasks that you would perform on the JetBackup GUI plus more features. You would be able to use the API to manually run jobs, create destinations, manage settings, etc.

JetApps CLI

The JetApps CLI commands allow you gather information on JetBackup packages as well as update/install/remove JetBackup Packages. See the table below for all available JetApps Flags or run the following command on your terminal

/usr/bin/jetapps --help

Options

The JetApps CLI has the following options:

Option Description Flag
list List all installed and available jetapps packages
-l / --list
list-installed List all installed jetapps packages
-d / --list-installed
info Print information about jetapps package
-i {package} / --info {package}
install Install a jetapps package on your system
-s {package} {tier} / --install {package} {tier}
update Update a jetapps package on your system
-u {package} / --update {package}
chtier Change a jetapps package tier
-t {package} {newTier} / --chtier {package} {newTier}
chupdate Change a jetapps package auto update status
-p {package} {yes/no} / --chupdate {package} {yes/no}
remove Remove a jetapps package from your system
-r {package} / --remove {package}
version Print jetapps cli tool version
-v / --version 
help Print the help screen to the terminal
-h / --help 

JetBackup 5 pkgacct

The JetBackup 5 pkgacct CLI command will allow you to backup an account locally in a .tar.gz file located in the Workspace Directory

To run pkgacct, run the following command as root user:

/usr/bin/jetbackup5 --pkgacct {ACCOUNT} [options]

Options

The pkgacct command accepts the following options:

Option Description Example
{ACCOUNT} REQUIRED: The username of the account you wish to backup.
jetbackup5 --pkgacct user1
-oSkip

Give the backup items of the account that you do NOT want to include in the backup.

  • config - Panel Configuration
  • homedir - Home Directory Files
  • db - Database
  • dbuser - Database Users
  • email - Email Accounts and Structure
  • ftp - FTP Accounts
  • cron - Cron Jobs
  • dns - DNS Zones
  • ssl - SSL Certificates
-oSkip config,homedir

JetBackup 5 restorepkg

The JetBackup 5 restorepkg CLI Command will restore an account using a JetBackup 5 Compressed Backup.

To run restorepkg, run the following command as root user:

/usr/bin/jetbackup5 --restorepkg {PKG_PATH} [options]

Options

The restorepkg command accepts the following options:

Option Description Example
{PKG_PATH} REQUIRED: The absolute path to the .tar.gz backup of the account you wish to restore.
 jetbackup5 --restorepkg /PATH/TO/TAR/jetbackup-acct.tar.gz 
-oOwner Set the new owner manually, Default Owner.
-oOwner {USERNAME}
-oPackage Set the new package manually, Default Package.
-oPackage {PACKAGE_NAME}
-oMerge Merge backup data with live account data, Default No
-oMerge {Yes/No}
-oTerminate Terminate account before restore Default No (only if account exists)
-oTerminate {Yes/No}
-oReseller Set the account as reseller, Default No (only if account is orphan or -oTerminate provided)
-oReseller {Yes/No}e>
-oSuspend Set the account as susepended after the restore, Default No.
-oSuspend {Yes/No}
-oIP Set the new IP Address manually, Default IP.
-oIP {IP_ADDR}

JetBackup 5 JB Config Export and Import

The JetBackup 5 Export CLI Command will generate a compressed JB Config file containing all the data from the JetBackup MongoDB and Installed Plugins/Repositories and store it in the /usr/local/jetapps/usr/jetbackup5/exports/ directory.

JetBackup will generate a Daily Export JB file and keep up to 7 stored snapshots. The Daily Export files are located in /usr/local/jetapps/usr/jetbackup5/dailyexports/{EXPORT_FILE} directory.

The JetBackup 5 Import CLI Command will extract and import the data from an exported JB Config file.

/usr/bin/jetbackup5 --export

/usr/bin/jetbackup5 --import {PATH/TO/EXPORT_FILE}

Options

The export/import command accepts the following options:

Option Description Example
{PATH/TO/EXPORT_FILE} REQUIRED FOR IMPORT: The absolute path to the .tar.gz JB Config export file.
jetbackup5 --import /PATH/TO/TAR/jetbackup5_export_XXXXXXXXXX.tar.gz

jb5login (Linux Panel)

The jb5login script generates a single-use session login URL for the active ssh user.

/usr/bin/jb5login

To create a single-use session login URL for a specific user, use the following:

/usr/bin/jetbackup5api -F panelAPI -D "call=createUserSession&user={USERNAME}"