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.

Force backup to run using new 11.38 system

Discussion in 'General Discussion' started by Gareth-AWD, May 8, 2013.

Thread Status:
Not open for further replies.
  1. Gareth-AWD

    Gareth-AWD Well-Known Member

    Joined:
    Jul 3, 2008
    Messages:
    144
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    London, UK
    cPanel Access Level:
    Root Administrator
    How can I force a backup to run on the new 11.38 system in command line?

    Best Answer:

     
    vladaztek likes this.
  2. ES - George

    ES - George Well-Known Member
    PartnerNOC

    Joined:
    Jun 12, 2011
    Messages:
    142
    Likes Received:
    1
    Trophy Points:
    16
    Location:
    UK
    cPanel Access Level:
    Root Administrator
    /scripts/cpbackup --force

    "The cpbackup script can be used to manually trigger system wide backups on your cPanel & WHM server."

    I would suggest reviewing this page for more: Command Line Scripts | cPanel, Inc.
     
  3. Veeble-Adam

    Veeble-Adam Active Member

    Joined:
    May 7, 2013
    Messages:
    43
    Likes Received:
    0
    Trophy Points:
    6
    cPanel Access Level:
    Root Administrator
    /scripts/cpbackup should be sufficient I guess..
     
  4. Gareth-AWD

    Gareth-AWD Well-Known Member

    Joined:
    Jul 3, 2008
    Messages:
    144
    Likes Received:
    2
    Trophy Points:
    18
    Location:
    London, UK
    cPanel Access Level:
    Root Administrator
    This triggers the legacy backup system from 11.36 not the 11.38 backup system.

    I need to manually trigger the new backup.
     
  5. InterServed

    InterServed Well-Known Member

    Joined:
    Jul 10, 2007
    Messages:
    255
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    DataCenter Provider
    Hello,

    The call for the new backup system originates at /usr/local/cpanel/bin/backup
     
  6. simonas

    simonas Well-Known Member

    Joined:
    Apr 21, 2013
    Messages:
    141
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Lithuania
    cPanel Access Level:
    Root Administrator
    Also it should be noted that you must disable legacy backup and enable new backup system on every account!
    Otherwise calling above command will do nothing (no accounts)

    To enable new backing system go to:
    Backup User Selection

    Disable legacy backup and enable new backup system for accounts.

    Then above command /usr/local/cpanel/bin/backup will work and will force backup.
     
    #6 simonas, May 9, 2013
    Last edited: May 9, 2013
  7. InterServed

    InterServed Well-Known Member

    Joined:
    Jul 10, 2007
    Messages:
    255
    Likes Received:
    2
    Trophy Points:
    18
    cPanel Access Level:
    DataCenter Provider
    You can also use the API calls to facilitate mass enable/disable until this options will be available directly on the WHM interface.

    Constructs do exist for enabling or disabling all users within API1.

    The following will enable legacy backups for all accounts

    Code:
    https://<hostname>:2087/<session_token>/xml-api/backup_skip_users_all?api.version=1&backupversion=legacy_backups&state=1
    The following will disable legacy backups for all accounts.

    Code:
    https://<hostname>:2087/<session_token>/xml-api/backup_skip_users_all?api.version=1&backupversion=legacy_backups&state=0
    The following will enable all accounts for the new backup system.

    Code:
    https://<hostname:2087/<session_token>/xml-api/backup_skip_users_all?api.version=1&backupversion=backups&state=1
    The following will disable all users from using the new backup system.

    Code:
    https://<hostname>:2087/<session_token>/xml-api/backup_skip_users_all?api.version=1&backupversion=backups&state=0
    Running any of the mentioned API calls will take some time to update (depending on how many accounts your machine has). Took me an average 10 minutes to disable legacy backup on 300 accounts.
     
    #7 InterServed, May 9, 2013
    Last edited: May 9, 2013
  8. kernow

    kernow Well-Known Member

    Joined:
    Jul 23, 2004
    Messages:
    865
    Likes Received:
    9
    Trophy Points:
    18
    cPanel Access Level:
    Root Administrator
    InterServed
    Thanks for the API URL above :)
     
  9. ddshadow

    ddshadow Member

    Joined:
    Nov 18, 2011
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hi!

    My question is,

    On the new backup Is there still the hooks for doing the Precpbackup and postcpbackup??

    Looking at the script i don't see any mention to the precpbackup, But i do see a Postcpbackup.

    if ( -e '/usr/local/cpanel/scripts/postcpbackup' && -x _ && ( !exists $$conf_ref{'POSTBACKUP'} || $$conf_ref{'POSTBACKUP'} ) )

    Any ideas if we can still use those hooks?
     
  10. ddshadow

    ddshadow Member

    Joined:
    Nov 18, 2011
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    futher info that may help you...

    result>
    <data>
    <backup_config>
    <backupdir>/backup/new/</backupdir>
    <usebinarypkgacct>0</usebinarypkgacct>
    <backup_monthly_dates>1,15</backup_monthly_dates>
    <backup_daily_enable>1</backup_daily_enable>
    <prebackup>-1</prebackup>
    <backupmount>0</backupmount>
    <backuptype>compressed</backuptype>
    <backuplogs>1</backuplogs>
    <backupenable>1</backupenable>
    <backup_monthly_enable>1</backup_monthly_enable>
    <psqlbackup>0</psqlbackup>
    <backup_daily_retention>14</backup_daily_retention>
    <errorthreshhold>3</errorthreshhold>
    <backupfiles>1</backupfiles>
    <backupbwdata>1</backupbwdata>
    <backup_monthly_retention>4</backup_monthly_retention>
    <keeplocal>1</keeplocal>
    <linkdest>0</linkdest>
    <backupaccts>1</backupaccts>
    <backupdays>0,1,2,3,4,6</backupdays>
    <postbackup>0</postbackup>
    <localzonesonly>1</localzonesonly>
    <gziprsyncopts/>
    <mysqlbackup>accounts</mysqlbackup>
    </backup_config>
    </data>
    <metadata>
    <reason>OK</reason>
    <command>backup_config_get</command>
    <result>1</result>
    <version>1</version>
    </metadata>
    </result>
    <!--


    I would love to have the Prebackup and postbackup working.
     
  11. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    The new backup system uses the standard hook system we introduced in 11.32 (Getting Started). Through that, bin/backup exposes both a pre and a post hook event.
     
  12. dgbaker

    dgbaker Well-Known Member
    PartnerNOC

    Joined:
    Sep 20, 2002
    Messages:
    2,578
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Toronto, Ontario Canada
    cPanel Access Level:
    DataCenter Provider
    A couple of issues with the new backup system.

    1. System backups will not be uploaded to any remote destinations - Kind of hard to restore a system without them, yet if on the failed machine you have lost access in most cases. These to to sent to remote destinations.

    2. Due the above, no backups are done to the remote destination is you have backup system files enabled. Would be nice if that is noted when configuring the backup system.
     
  13. ddshadow

    ddshadow Member

    Joined:
    Nov 18, 2011
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    On version 11.36 All was working i had 2 files under the /usr/local/cpanel/scripts

    precpbackup
    postcpbackup
    Both were call once the Cron job would be run.

    With the version 11.38 None of them are been call, so i am not sure if i need change them into the new backup script place, or if i need do something in the etc/cpbackup.conf.

    Please Advise
     
  14. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    For item number one, please read System Backups

    For item number two, do you have both Backup Accounts and Backup System Files enabled?
     
  15. ddshadow

    ddshadow Member

    Joined:
    Nov 18, 2011
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Could you let us know how to enable the precpbackup and postcpbackup?
     
  16. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    You need to switch to the Standard Hook system, as I mentioned earlier. The hook event you want is System::Backup. There is both a pre and post stage, which roughly approximates precpbackup and postcpbackup. The System::Backup event is in the process of being documented, it was overlooked.
     
  17. ddshadow

    ddshadow Member

    Joined:
    Nov 18, 2011
    Messages:
    10
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Hello!

    I am aware that am not a seasoning cPanel Admin, but i have no clue what you are talking about.

    Under the "Manage hooks" Version 11.38:
    Home »Development »Manage Hooks

    There is no mention to backups.

    If i look on switch to the Standard Hook system, I don't get nothing.

    Could you point me out to the right direction please?
     
  18. BrentH

    BrentH Registered

    Joined:
    Mar 19, 2012
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    So, am I missing something here or do you have to manually select EVERY use account you want to back up? Is there not an option to select all?!
     
  19. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    This feature will be included in cPanel version 11.38.1 per internal case number 70329. In the meantime, the following API calls can be made as a workaround:

    Code:
    [WHM:port]/[cpsession]/json-api/backup_skip_users_all?api.version=1&state=disable&backupversion=legacy_backup
    [WHM:port]/[cpsession]/json-api/backup_skip_users_all?api.version=1&state=enable&backupversion=backup
    Thank you.
     
  20. tsiedsma

    tsiedsma Active Member

    Joined:
    Nov 1, 2006
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Ankeny, Iowa
    cPanel Access Level:
    Root Administrator
    Twitter:
    It appears that cpbackup-userskip.conf is ignored by the new backup system. Is there a way to add users to a skip list like before? Internal processes run and scan accounts that violate our backup policy, the accounts are added to this file and backups are skipped. It appears those accounts are actually being backed up by the new system.
     
Loading...
Thread Status:
Not open for further replies.

Share This Page