Andy Thomas
Andy Thomas

Reputation: 79

how to create crontab for auto run command "service php-fpm restart" in centos 6?

I want to run command "service php-fpm restart" each 1 minute and I tried to using contab.

I tried this code in contab file:

0/1 * * * * service php-fpm restart

In the file crontab from /var/spool/con/root, I put these code:

0 2 * * * chown -R nginx:nginx /home/
0 3 * * * echo 1 > /proc/sys/vm/drop_caches
0 4 * * * reboot
0/1 * * * * service php-fpm restart

All the command almost are running , but the command "service php-fpm restart" not.

Upvotes: 2

Views: 2139

Answers (1)

lpaseen
lpaseen

Reputation: 1239

Besides the big question of why you need to restart every minute (feels like fixing a flat by making sure you have a airpump handy instead of stopping the leak) I wonder how you got a minute of "0/1"? To run something every minute you give it five stars

* * * * * /sbin/service php-fpm restart

Upvotes: 1

Related Questions