Just installed crontab manager so I could create my own cronjobs easily. I created one to restart the php80-php-fpm daemon (to clear out PHP opcache weekly), having root as the user and/user/bin/systemctl restart php80-php-fpm.service for the command. Or should I leave the directories out of the command and just use systemctl restart php80-php-fpm.service? Which is the proper command to enter in the app? If I test it from a Putty terminal logged in as root, /user/bin/systemctl restart php80-php-fpm.service spits back no such file or directory, but that could be because I’m already logged in as root.
As a side note, it would be nice if the app had a RUN NOW button to test the cronjob out.
Is it even necessary to do this or does opcache flush itself automatically as needed?
AFAIK, systemctl restart servicename (Call does NOT need full path!)will not give any feedback.
But systemctl status servicename will…
So I pack both lines in a small script, add in a logging output to /var/log/myjobs (The script actually checks in first run if this folder exists, if not it will create it and use that to place any logging / output).
and run the cronjob I need…
I keep alls such jobs in /etc/Jobs, this since more than 20 years now…
I’m not 100% sure, but AFAIK, php8 opcache cleans itself…
Maybe @stephdl can help here…
Thank you for the replies. I removed the path from the command. The code for crontab manager puts the script for the job directly in the crontab config file. That doesn’t bother me. I think it’s a nice feature. I’ll have to read through Marc’s links and see how I can see how full the opcache is and compare before and afters.