Cron Job php restart

I’m a newbie working with Ubuntu 22.04, and I’m using HestiaCP. I wanted to know if it’s possible to restart PHP 7.4-FPM using a cron job.

If so, how would I set that up? I need to restart PHP 7.4-FPM regularly (for example, every hour).

Any help or guidance would be greatly appreciated!

Thanks in advance!

Use this to add a cron job to restart the service every hour:

sudo su -
(crontab -l ; echo '0 * * * * systemctl restart php7.4-fpm') | crontab
1 Like