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.

Run script after whm backup

Discussion in 'General Discussion' started by trec-r, Jul 3, 2011.

  1. trec-r

    trec-r Active Member

    Joined:
    Aug 10, 2008
    Messages:
    41
    Likes Received:
    2
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    I have a number of accounts that I want to and am currently backing up using the whm backup tool. I want to run a script when the backup is finished. It would be even better if I could run this small script after each accounts backup is finished.

    Any ideas on how best to do this? The best idea I could think of was to use a script to track when the backups were last modified then trigger the next script when the backup is done. However that could get messed up depending on how the backup files are written and server load.

    Using WHM 11.30.0 (build 32) on Fedora 7. So a few questions. In the configure backup there is nothing to set the time that it starts, just the days it runs. So I would guess that cron is running it at midnight of the days selected? Is there a command name that I could monitor? Does it re-spawn to backup each account?

    Thanks
    Richie
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,737
    Likes Received:
    661
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello :)

    You can create and utilize the following file:

    Code:
    /scripts/postcpbackup
    This script will run immediately following "/scripts/cpbackup", which is what runs when the accounts are backed up. More information on our script hooks can be found at:

    Script Hooks

    You can also install the "cronconfig" plugin in order to edit the cPanel cron jobs (such as cpbackup) via Web Host Manager. This can be installed via:

    "WHM >> cPanel >> Manage Plugins"

    I would like to point out that Fedora 7 is "end of life", so it's advised that you switch to a supported OS as soon as possible. You can find more information on our End Of Life policy at:

    Operating System End of Life Policy for cPanel & WHM

    Thank you.
     
  3. trec-r

    trec-r Active Member

    Joined:
    Aug 10, 2008
    Messages:
    41
    Likes Received:
    2
    Trophy Points:
    8
    cPanel Access Level:
    Root Administrator
    Thanks Michael, not sure how I missed that in my searching. Might have had something to do with not enough sleep. Read you loud and clear on Fedora 7, this is all part of upgrading to a new server.

    Thanks
    Richie
     
Loading...

Share This Page