cPanel update script that is executed every night is /scripts/upcp and according to its code, file named /scripts/postupcp will get executed at the end:
if (-e "/scripts/postupcp") {
system("/scripts/postupcp");
}
We can use this file to add a custom command that will execute after the update.
Cloudlinux already uses it:
cat /scripts/postupcp
#!/bin/bash
/usr/share/cloudlinux-linksafe/cpanel/hooks/cloudlinux_linksafe_hook.sh #cloudlinux-linksafe
/usr/share/l.v.e-manager/cpanel/hooks/l.v.e-manager_postupcp_hook.sh #l.v.e-manager
/usr/share/cagefs/cpanel/cagefs_postupcp_hook.sh #CageFS Version 2.0. Update CageFS after update of CPanel
/usr/share/lve/dbgovernor/cpanel/upgrade-mysql-disabler.sh #dbgovernor
If the file does not exist, create it and add your custom script:
nano /scripts/postupcp
/usr/share/something-custom/run-after-update.sh #my custom script
We can even use our custom install script to add code to the /scripts/postupcp
line_to_add="/usr/share/something-custom/run-after-update.sh #my custom script"
# Check if already added, if not add it
if ! grep -qF "$line_to_add" /scripts/postupcp; then
echo "$line_to_add" >> /scripts/postupcp
fi

![WARNING: [pool user_USERNAME] server reached pm.max_children setting (25), consider raising it Screen Shot 2020 06 23 at 09.57.51 - WARNING: [pool user_USERNAME] server reached pm.max_children setting (25), consider raising it](https://i0.wp.com/administrator.pejcic.rs/wp-content/uploads/2026/09/Screen-Shot-2020-06-23-at-09.57.51.png?resize=344%2C194&ssl=1)

![node[175421]: pthread_create: Resource temporarily unavailable 2023 08 28 12 15 - node[175421]: pthread_create: Resource temporarily unavailable](https://i0.wp.com/administrator.pejcic.rs/wp-content/uploads/2023/08/2023-08-28_12-15.png?resize=344%2C194&ssl=1)