Example of jetcli command

cPanel, Industry leading hosting platform with world-class support.
Post Reply
havri
Posts: 22
Joined: August 10th, 2017, 4:10 pm

Example of jetcli command

Post by havri »

Hello,

I want to do some settings in the jetbackup via the jetcli command. For example, I've tried to edit the "gziponsql" setting from the performance setttings page:

Code: Select all

root@server1 [/etc/jetapps/apps/jetbackup/exclude]# jetcli backup -P settings::performance
Key                   Description                              Value
--------------------------------------------------------------------
queueactive           Queue-Active                             0    
rsyncbwlimit          Rsync-Bandwidth-Limit-(KB/s)             0    
ioniceactive          ionice-Active                            0    
ionice_class          ionice-Class                             0    
ionice_classdata      ionice-Class-Data                        0    
reniceactive          renice-Active                            0    
renicepriority        renice-Priority                          0    
lveactive             CloudLinux-LVE-Active                    0    
lveuser               CloudLinux-LVE-User-ID                   0    
lveio                 CloudLinux-LVE-IO-Limit-(KB/s)           0    
lvecpu                CloudLinux-LVE-CPU-Limit-(percent)       0    
skipbwdata            Skip-Bandwidth-Data                      0    
skipmailman           Skip-Mail-Man                            0    
keepusersdata         Keep-Users-Data                          0    
updateincsize         Update-Remote-Incremental-Backups-Sizes  0    
maxloadaverage        Restore-Server-Load-Limits               0    
restoresleep          Restore-sleep-time-(seconds)             0    
limitdownloads        Limit-accounts-Downloads                 0    
gziponsql             Compress-databases-on-backup-process     0    
mysqldump_max_packet  MySQL-Dump-max-allowed-packet            0    
mysqldump_force       MySQL-Dump-Force-flag                    0    
mysqldump_opt         MySQL-Dump-opt-flag                      0    
mysqldump_skip_lock   MySQL-Dump-skip-lock-table-flag          0    
The commands I've used are:

root@server1 [/etc/jetapps/apps/jetbackup/exclude]# jetcli backup -P settings::performance -V manage
The file /usr/local/cpanel/whostmgr/docroot/jetbackup/views/settings_performance_default.php is missing!
root@server1 [/etc/jetapps/apps/jetbackup/exclude]# jetcli backup -P settings::performance -V manage settings::performance
The file /usr/local/cpanel/whostmgr/docroot/jetbackup/views/settings_performance_default.php is missing!
root@server1 [/etc/jetapps/apps/jetbackup/exclude]# jetcli backup -P settings::performance -V settings::performance manage

Can someone point me in the right direction with some examples?

Thank you.
User avatar
elialum
Staff Member
Staff Member
Posts: 95
Joined: October 25th, 2015, 1:44 pm

Re: Example of jetcli command

Post by elialum »

Hi,

You need to send the entire settings of the affected page, or else they will be "zeroed" (I know it's annoying, we changed that in JetBackup 3.2)

Here is an example from the "settings::performance" page. In this example I changed 3 values -
gziponsql, rsyncbwlimit, queueactive. All the rest got 0 value since I ignored them in the API command.

API command example -

Code: Select all

jetcli backup -P settings::performance -A save -D '{
	"gziponsql":1,
	"rsyncbwlimit":2048,
        "queueactive":1
}'
Output example -

Code: Select all

#jetcli backup -P settings::performance 
Key                   Description                              Value
--------------------------------------------------------------------
queueactive           Queue-Active                             1    
rsyncbwlimit          Rsync-Bandwidth-Limit-(KB/s)             2048 
ioniceactive          ionice-Active                            0    
ionice_class          ionice-Class                             0    
ionice_classdata      ionice-Class-Data                        0    
reniceactive          renice-Active                            0    
renicepriority        renice-Priority                          0    
lveactive             CloudLinux-LVE-Active                    0    
lveuser               CloudLinux-LVE-User-ID                   0    
lveio                 CloudLinux-LVE-IO-Limit-(KB/s)           0    
lvecpu                CloudLinux-LVE-CPU-Limit-(percent)       0    
skipbwdata            Skip-Bandwidth-Data                      0    
skipmailman           Skip-Mail-Man                            0    
keepusersdata         Keep-Users-Data                          0    
updateincsize         Update-Remote-Incremental-Backups-Sizes  0    
maxloadaverage        Restore-Server-Load-Limits               0    
restoresleep          Restore-sleep-time-(seconds)             0    
limitdownloads        Limit-accounts-Downloads                 0    
gziponsql             Compress-databases-on-backup-process     1    
mysqldump_max_packet  MySQL-Dump-max-allowed-packet            0    
mysqldump_force       MySQL-Dump-Force-flag                    0    
mysqldump_opt         MySQL-Dump-opt-flag                      0    
mysqldump_skip_lock   MySQL-Dump-skip-lock-table-flag          0    
I hope it's more clear now :)

Thanks,
Eli.
havri
Posts: 22
Joined: August 10th, 2017, 4:10 pm

Re: Example of jetcli command

Post by havri »

Hello,

Thank you for your reply. The command works perfect on numerical values (like 0, 1, 30 and so on), but I cannot seem to get it to work on paths. For example, I tried setting the timezone to "Europe/Copenhagen", but I didn't manage to get it to work. Tried it like this:

Code: Select all

jetcli backup -P settings::general -A save -D '{"timezone": Europe/Bucharest}'
jetcli backup -P settings::general -A save -D '{"timezone": Europe\/Bucharest}'
jetcli backup -P settings::general -A save -D '{"timezone": "Europe/Copenhagen"}'
jetcli backup -P settings::general -A save -D '{"timezone": "Europe\/Copenhagen"}'
After I try to set the timezone via the jetcli command, the entry for the timezone is empty:

Code: Select all

[root@myserver ~]# jetcli backup -P settings::general
Key                      Description                           Value                                
----------------------------------------------------------------------------------------------------
errorreporting           Error-Reporting                       1                                    
debug                    Debug-Active                          0                                    
dateformat               Date-Format                           d-M-Y-h:i-A                          
timezone                 Timezone                                                                   
workspace_path           Workspace-Directory                   /etc/jetapps/apps/jetbackup/workspace
deleteorphan             How-Long-Keep-Orphan-Backups-(days)   7                                    
killzombies              Kill-zombie-pid's-(days)              7                                    
logstime                 How-long-keep-logs-(days)             30                                   
notifyactive             API-Notification-system-Active        0                                    
notifydebug              API-Notification-system-debug-Active  0                                    
notifyurl                API-Notification-system-URL                                                
clearcachetime           Scheduled-Clear-Cache-Active          1                                    
clearcachetime_interval  Scheduled-Clear-Cache-Interval        sunday                               
clearcachetime_hour      Scheduled-Clear-Cache-Hour            01                                   
clearcachetime_min       Scheduled-Clear-Cache-Minute          00                                   
clearcachetime_ampm      Scheduled-Clear-Cache-AM/PM           am              

I am currently encountering this issue on all the following entries:

timezone, workspace_path, clearcachetime, clearcachetime_interval, clearcachetime_hour, clearcachetime_min, clearcachetime_ampm

One other entry that I've tried to edit was on the Settings -> Notifications page. If I try to edit the email address that should receive email, it doesn't add anything and all the rest entries are reset to "No":

Code: Select all

[root@myserver ~]# jetcli backup -P settings::notify
Key             Description                 Value
-------------------------------------------------
notifyemail     Email-Notifications              
globalnotify    Global-Notify               0    
restorenotify   Restore-Notify              0    
jobsnotify      Jobs-Notify                 0    
snapshotnotify  Snapshot-Notify             0    
clonenotify     Clone-Notify                0    
cachenotify     Clear-Cache-process-Notify  0    
downloadnotify  Download-process-Notify     0    
cronnotify      Daily-Cron-Notify           0    

Let me know if you need any other info.

Thank you.
havri
Posts: 22
Joined: August 10th, 2017, 4:10 pm

Re: Example of jetcli command

Post by havri »

Hello,

I see that a problem has been solved. Issuing the following command now sets the correct workspace path:

Code: Select all

jetcli backup -P settings::general -A save -D '{"workspace_path":"\/home\/jetbackup_restores\/"}'
But the thing that it does is it resets the timezone settings and puts it to "PHP Default timezone". The timezone can still not be set through the jetcli utility.

Thank you.
User avatar
elialum
Staff Member
Staff Member
Posts: 95
Joined: October 25th, 2015, 1:44 pm

Re: Example of jetcli command

Post by elialum »

Hi,

Seems like there is indeed an issue specific with the timezone.

I've opened an internal case for our developers (JB155), please check our changlog occasionally to track the progress -

https://docs.jetapps.com/jetbackup/changelog

Thanks,
Eli.
havri
Posts: 22
Joined: August 10th, 2017, 4:10 pm

Re: Example of jetcli command

Post by havri »

Hello,

Thank you for opening an internal case. I am replying just to make sure that my problem was understood correctly. This doesn't happen only on the timezone entry, but for example also on the "mysqldump_max_packet" entry:

Code: Select all

jetcli backup -P settings::performance -A save -D '{"mysqldump_max_packet":1024}'
After issuing the above command, all the settings::performance page is reset to 0 value for all other entries.

Thank you.
User avatar
elialum
Staff Member
Staff Member
Posts: 95
Joined: October 25th, 2015, 1:44 pm

Re: Example of jetcli command

Post by elialum »

Hi Havri,

Thank you for the followup :)
There will be major changes in the API system, so keep track on our changelog.

Thanks,
Eli.



Eli.
Post Reply