Wrote a script, let Crond to periodically execute the script to backup, but in the crontab-e inside the execution script, found that no execution, and later analyzed, Crond not perform the main reasons are as follows:
1, Crond service did not start
Service Crond Start//Startup services
Service Crond stop//Shutdown services
Service Crond restart//Restart services
Service Crond Reload//Reload Configuration
2. User does not have permission to perform Crond
The/etc/cron.deny file is used to control which users cannot perform the functions of the Crond service.
You can delete yourself from the file, or contact root
3. Crontab does not provide environment variables for the executing user
Workaround: Add the following line to the script:
. /etc/profile
4. Absolute path not used
The absolute path here includes the path in the script and two aspects of the path in the Crond command.
5. If none of the above solves the problem, you can look for the problem again:
1) go to the mail to see, in the process of the user should receive the message, such as receiving such a prompt:
You have mail in/var/spool/mail/root
Go look inside, there's crond.
2) Add output to the script to debug
You can add an echo $PATH >/tmp/test.log to the crontab script
echo $PATH for executing scripts in contrast and terminal
Crond do not perform cause analysis