Run script after whm backup

trec-r

Active Member
Aug 10, 2008
44
2
58
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
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,884
2,250
463
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.
 

trec-r

Active Member
Aug 10, 2008
44
2
58
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