Skip to main content

rsync after backup ends

Comments

3 comments

  • ModServ
    From backup script "/usr/local/cpanel/bin/backup", you can find this: /usr/local/cpanel/scripts/postcpbackup
    if ( -e '/usr/local/cpanel/scripts/postcpbackup' && -x _ && ( !exists $$conf_ref{'POSTBACKUP'} || $$conf_ref{'POSTBACKUP'} ) ) { $logger->info("Executing user defined post backup script (/usr/local/cpanel/scripts/postcpbackup)."); system '/usr/local/cpanel/scripts/postcpbackup'; }
    0
  • adjc98
    I am assuming the script above is in pearl. I am not familiar with pearl, but what it looks like is that postcpbackup should be ran after the cpanel backup process is over. What I have in /usr/local/cpanel/scripts/postcpbackup doesn't get run after I do a backup. Is there something else I should do to make the if statement run true? I am not sure what -x _ is for and I have both config files for set for true for legacy and new backup. if ( -e '/usr/local/cpanel/scripts/postcpbackup' && -x _ && ( !exists $$conf_ref{'POSTBACKUP'} || $$conf_ref{'POSTBACKUP'} ) ) { $logger->info("Executing user defined post backup script (/usr/local/cpanel/scripts/postcpbackup)."); system '/usr/local/cpanel/scripts/postcpbackup'; } Is there something I need to restart so the config files are updated in the config cache?
    0
  • cPanelMichael
    Hello :) You can register a hook after creating the custom script you want to run after backup generations with a command such as:
    /usr/local/cpanel/bin/manage_hooks add script /root/post_backup --category System --event Backup --stage post
    This assumes your script is located at /root/post_backup. Thank you.
    0

Please sign in to leave a comment.