Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Can a Reseller create Full backups via cron?

Discussion in 'Data Protection' started by rec9140, May 3, 2017.

  1. rec9140

    rec9140 Member

    Joined:
    Jun 7, 2007
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    151
    I've read and found numerous threads on doing backups via cron with all sorts of info.. and well most of it involves "hacks" or something that is not reliable, or just plain outdated!

    I'd like to get just the facts maam! On how to create a FULL BACK UP via cron, if it can sfp/scp it out to a remote storage area, great... but I can create my own BASH script to do that.

    The setup is a Reseller account on WHM and one of the CPanel accounts needs more backups than the hosts backup system creates, plus more backups is always better!

    In /usr/local/cpanel/bin

    I have :

    Code:
    -rwxr-xr-x  1 root    root       81645 Apr 18 15:57 backup
    lrwxrwxrwx  1 root    root          19 Apr  4 02:15 backupadmin -> admin/Cpanel/backup
    -rwxr-xr-x  1 root    root        2399 Mar 15 11:35 backup_cmd
    -rwx------  1 root    root    56236736 Apr 18 15:56 backup_restore_manager
    lrwxrwxrwx  1 root    root           6 Apr  4 02:15 backupwrap -> cpwrap
    
    
    -rwxr-xr-x  1 root    root    24613800 Apr 25 04:03 pkgacct
    
    
    I just want to setup a cronjob to do a FULL BACKUP of that account. .then I will pass that off to a BASH script to scp/sftp it elsewhere...

    00 00 * * * /usr/local/cpanel/bin/backup --force

    This will then create the files I've been doing by hand via the CPanel like:

    Code:
    rw-------  1 ime me 23957795 Apr 26 06:19 backup-4.26.2017_06-18-34_me.tar.gz
    -rw-------  1 me me 13184386 Apr  7 17:49 backup-4.7.2017_17-49-18_me.tar.gz
    -rw-------  1 me me 30200109 May  3 14:49 backup-5.3.2017_14-47-40_me.tar.gz
    
    I can script sending them out...

    I just want the current correct version of doing this....

    Thanks.
     
  2. 24x7server

    24x7server Well-Known Member

    Joined:
    Apr 17, 2013
    Messages:
    1,491
    Likes Received:
    60
    Trophy Points:
    28
    Location:
    India
    cPanel Access Level:
    Root Administrator
    Hi,

    Check the ownership of the owned by root, group is root, howver, it does have read-execute permission to the other group, but these commands may require root access to execute it. However, check if you are able to execute /scripts/pkgacct command from your shell...

    Check the below link:
    WHM Backup for Reseller Accounts
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,659
    Likes Received:
    1,427
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    The ability to configure and schedule backups requires root access to the system. I encourage you to vote and add feedback to the following feature request if you'd like to see this functionality extended to resellers:

    WHM Backup for Reseller Accounts

    One potential workaround in the meantime is to access cPanel for the individual accounts you want backed up, and setup a cron job using the command referenced on the feature request here:

    Automatic Backup of single cPanel account

    Thank you.
     
  4. rec9140

    rec9140 Member

    Joined:
    Jun 7, 2007
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    151
    This option doesn't appear to be an option:

    Code:
    bin]$ pwd
    /usr/local/cpanel/bin
    [im bin]$ ./cpapi1 Fileman fullbackup homedir
    [2017-05-10 14:23:48 -0700] warn [cpapi1] Failed to execute /usr/local/cpanel/cpanel: No such file or directory at /usr/local/cpanel/Cpanel/XML.pm line 121.
            Cpanel::XML::cpanel_exec_fast(HASH(0x9e2d78), HASH(0x174ca98)) called at bin/apitool.pl line 152
            bin::apitool::_run_cpanel_function("yaml", HASH(0x9e2d78)) called at bin/apitool.pl line 117
            bin::apitool::_cpanel_api_handler("cpapi1", HASH(0x1745018), "yaml", ARRAY(0x9e2ee0)) called at bin/apitool.pl line 90
            bin::apitool::run(__CPANEL_HIDDEN__, __CPANEL_HIDDEN__, __CPANEL_HIDDEN__) called at bin/apitool.pl line 25
    warn [cpapi1] Failed to execute /usr/local/cpanel/cpanel: No such file or directory
    Failed to execute /usr/local/cpanel/cpanel: No such file or directory at bin/apitool.pl line 153.
    [im bin]$ cpapi1 Fileman fullbackup homedir
    -bash: cpapi1: command not found
    
    lrwxrwxrwx  1 root    root           7 Apr  4 02:15 cpapi1 -> apitool
    lrwxrwxrwx  1 root    root           7 Apr  4 02:15 cpapi2 -> apitool
    lrwxrwxrwx  1 root    root           7 Apr  4 02:15 cpapi3 -> apitool
    
    ]$ ./cpapi1 Fileman fullbackup homedir me@me.invalid
    
    [2017-05-10 14:31:15 -0700] warn [cpapi1] Failed to execute /usr/local/cpanel/cpanel: No such file or directory at /usr/local/cpanel/Cpanel/XML.pm line 121.
            Cpanel::XML::cpanel_exec_fast(HASH(0x9e2d78), HASH(0x24e4280)) called at bin/apitool.pl line 152
            bin::apitool::_run_cpanel_function("yaml", HASH(0x9e2d78)) called at bin/apitool.pl line 117
            bin::apitool::_cpanel_api_handler("cpapi1", HASH(0x24dc668), "yaml", ARRAY(0x9e2ee0)) called at bin/apitool.pl line 90
            bin::apitool::run(__CPANEL_HIDDEN__, __CPANEL_HIDDEN__, __CPANEL_HIDDEN__, __CPANEL_HIDDEN__) called at bin/apitool.pl line 25
    warn [cpapi1] Failed to execute /usr/local/cpanel/cpanel: No such file or directory
    Failed to execute /usr/local/cpanel/cpanel: No such file or directory at bin/apitool.pl line 153.
    
    
    
    
    Any further ideas??? I need to have automated backups above what the host will do... and *manually* doing it is not the way.
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,659
    Likes Received:
    1,427
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Could you verify which version of cPanel is installed on this system?

    Thank you.
     
  6. rec9140

    rec9140 Member

    Joined:
    Jun 7, 2007
    Messages:
    6
    Likes Received:
    0
    Trophy Points:
    151
    CPanel 64.0.20

    Code:
    
    cPanel Version 64.0 (build 20)
    Apache Version 2.4.25
    PHP Version 5.6.30
    MySQL Version 5.6.35
    Architecture x86_64
    Operating System linux
    
    Path to Sendmail /u
    Path to Perl /u
    Perl Version 5.10.1
    Kernel Version 2.6.32-673.26.1.lve1.4.24.el6.x86_64
     
  7. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,659
    Likes Received:
    1,427
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    You'd need to report this issue to your web hosting provider to have them take a closer look at why it's not working as expected.

    Thank you.
     
Loading...

Share This Page