1 crond service not started
Crontab is not a Linux kernel function, but depends on a crond service, which can be started or stopped. If you stop the task, you cannot execute any scheduled task. The solution is to open it:
Crond
Or
Service crond start
If the crond command does not exist, it may be deleted by mistake. In CentOS, You can reinstall the command:
Yum-y install crontabs
2. Permission issues
For example, the script does not have the x execution permission. solution:
Add execution permission or execute the command using bash abc. sh.
3. Path Problems
Some commands run normally in shell, but they always fail to be executed in crontab. It may be because the sh used by crontab does not recognize the path correctly. For example, if you log on to the shell as a root and run a/root/test. sh command
./Test. sh
You can. However, the script cannot be found in crontab. For example, the script is complete:
/Root/test. sh
4. Time Difference
Because of the time difference between the server and the client, the crontab time is based on the server time.
5 variable problems
Sometimes the command contains variables, but the crontab does not exist during execution, and the execution may fail.