Shell Crontab not working


GNU nano 2.0.9 File: /tmp/crontab.XXXXzBQgwS

*/5 * * * * ~/check_phpfpm.sh */5 * * * * ~/check_nginx.sh */5 * * * * ~/disk-clean.sh */5 * * * * ~/loadcheck.sh

By right my code should run every 5 minutes. but it doesn't run

[root@4D13 ~]# ls -l total 756 -rw-------. 1 root root 1688 Dec 18 09:45 anaconda-ks.cfg -rwxrwxrwx 1 root root 139 Dec 28 18:18 check_nginx.sh -rwxrwxrwx 1 root root 140 Dec 28 18:19 check_phpfpm.sh -rwxrwxrwx 1 root root 456 Dec 28 18:18 disk-clean.sh -rw-r--r--. 1 root root 15469 Dec 18 09:45 install.log -rw-r--r--. 1 root root 5267 Dec 18 09:44 install.log.syslog -rwxrwxrwx 1 root root 503 Dec 19 19:26 loadcheck.sh drwxr-xr-x 9 1001 1001 4096 Dec 18 11:08 nginx-1.3.2 -rw-r--r-- 1 root root 722119 Jun 26 2012 nginx-1.3.2.tar.gz [root@4D13 ~]#

It should run ~/check_phpfpm.sh as my code if i run manually it will work

[root@4D13 ~]# [root@4D13 ~]# ~/check_phpfpm.sh Stopping php-fpm: [FAILED] Starting php-fpm: [ OK ]

More about check_phpfpm, it is a script that check if the service php-fpm is running, if it not working ,it will execute and restart php-fpm, but the issue is if i run manually its work. but the crontab does not restart, the server php-fpm crashed and went to stop mode, but this script does not restart, my crontab should execute the script every 5 mins to check.

What is wrong with my crontab setup? Thanks for all help


First make sure your scripts are executable:

chmod u+x name_of_script

Now add it to crontab:

crontab -e

Also make sure you are writing the full path in the crontab e.g:

*/5 * * * * /home/user/loadcheck.sh


Are you sure the CRON service is firing? Maybe it is not even running.

Depending on your distro you can check that its running it not using something like...

# service crond status

If it is running, and your scripts are not firing then there is probably a permissions or location issue. Can you use ~ via CRON? Maybe try putting the absolute path to your scripts in such as /home/user/check_phpfpm.sh for example.

If your getting an error back from CRON, either check your CRON log, probably located at /var/log/cron or somewhere similar or have the CRON output emailed to you by adding the following on the first line of your CRONTAB...



  • Scrapyd not starting at boot-up - Ubuntu 14
  • NSKeyedUnarchiver crashes swift 3 on the second run
  • Android store byte[] in the keystore
  • LoggerFields for Syslog with log4j2.properties file
  • How to display the output of a Linux command on stdout and also pipe it to another command? [duplica
  • Using Python and BeautifulSoup to Parse a Table
  • java keystore and password changing
  • Parsing JSON Lines with Alamofire/Codable
  • PyInstaller Tkinter window low resolution in App bundle, but not in app program
  • Stale-while-revalidate cache replacement from Varnish
  • Deployment Rails app for Docker
  • How to exit “docker run” containers once the script those containers execute calls exit()
  • How to configure setenv.sh for tomcat8?
  • Matlab and mechanics (mostly physics)
  • How should I organize my c# solution?
  • AWS Elastic Beanstalk - changing owner of webapp folder
  • Python kernel dies when importing tensorflow 1.7
  • Opening a corrupted PyTables HDF5 file
  • Why do Unicode characters show up properly in database, but as ? when printed in Java via Hibernate?
  • Can't configure nginx as a proxy for tomcat with context path
  • How do I deploy my Node.js app with a opencv4nodejs dependency to Heroku?
  • Where should I store a file in Android?
  • Generate list with conditional items
  • Installing Python modules with Anaconda or Canopy
  • What do I do with this error when I run tests in rails?
  • How do I add a UIAlertController in app delegate (obj-c)
  • Android application not restoring state when installed from .apk, works fine from eclipse
  • Install phpMongo Drivers on windows
  • Cordova Apache wrong module path
  • ASPNetCore MVC Routing Let Server Handle Specific Route
  • Segmentation Fault on MySQL2 / Ruby 1.9.3 / Rails 3.2
  • Changing Jupyter Notebook start up folder by modifying “start in” not working any more
  • OSX - always hide certain files
  • Compiling dlib on OS X
  • How to generate and display a QR Code in ionic 2
  • Make VS2015 use angular-cli ng at build time in a .NET project
  • Can a Chrome extension content script make an jQuery AJAX request for an html file that is itself a
  • Upload files with Ajax and Jquery
  • AngularJs get employee from factory
  • Proper way to use connect-multiparty with express.js?