Crontab Failure Emails
The emails vary in subject line but include:
/bin/sh: 1 : ambiguous redirect - Cron <root@host> /usr/local/cpanel/bin/dcpumon >/dev/null 2>&1
/bin/sh: 1 : ambiguous redirect - Cron <root@host> /usr/local/cpanel/whostmgr/bin/dnsqueue > /dev/null 2>&1
/bin/sh: 1 : ambiguous redirect - Cron <root@host> /usr/local/cpanel/scripts/cpremotetaskadmin > /dev/null 2>&1
Cause:
root's crontab at /var/spool/cron/root was modified outside Linux at some point and corrupted for the line endings.
Problem Test:
Run the following conmmand.
# file /var/spool/cron/root
The output should be like this if there is no error with the file: /var/spool/cron/root: ASCII text
If you are getting an output like the folowing, the file is modified with some unsupported terminators.
Solution:
# strings /var/spool/cron/root > /var/spool/cron/root.tmp
# mv /var/spool/cron/root.tmp /var/spool/cron/root
Here, strings command convert the characters in the file into unix readable format. So all the unsupported characters will be supported by unix.
Run the following command to test the problem is soved,
# file /var/spool/cron/root
If you are getting the above output, the problem of getting cron failure emails solved.
Note:- The problem can occur with any crontab files. So, if you have any problem with any other crontab files, you can solve then by the above method.
You can also use
# dos2unix -b /var/spool/cron/root
instead of strings command
The emails vary in subject line but include:
/bin/sh: 1 : ambiguous redirect - Cron <root@host> /usr/local/cpanel/bin/dcpumon >/dev/null 2>&1
/bin/sh: 1 : ambiguous redirect - Cron <root@host> /usr/local/cpanel/whostmgr/bin/dnsqueue > /dev/null 2>&1
/bin/sh: 1 : ambiguous redirect - Cron <root@host> /usr/local/cpanel/scripts/cpremotetaskadmin > /dev/null 2>&1
Cause:
root's crontab at /var/spool/cron/root was modified outside Linux at some point and corrupted for the line endings.
Problem Test:
Run the following conmmand.
# file /var/spool/cron/root
The output should be like this if there is no error with the file: /var/spool/cron/root: ASCII text
If you are getting an output like the folowing, the file is modified with some unsupported terminators.
/var/spool/cron/root: ASCII text, with CRLF, LF line terminators
Solution:
# strings /var/spool/cron/root > /var/spool/cron/root.tmp
# mv /var/spool/cron/root.tmp /var/spool/cron/root
Here, strings command convert the characters in the file into unix readable format. So all the unsupported characters will be supported by unix.
Run the following command to test the problem is soved,
# file /var/spool/cron/root
/var/spool/cron/root: ASCII text
If you are getting the above output, the problem of getting cron failure emails solved.
Note:- The problem can occur with any crontab files. So, if you have any problem with any other crontab files, you can solve then by the above method.
You can also use
# dos2unix -b /var/spool/cron/root
instead of strings command
Thanks! :)
Thank you so much, saved my day!!!!!!
Been trying to figure this issue for months... Thank you!!!!Line endings.. who would have thought... cron is so temperamental!
Genius... cheers
Great Article. Thank you for sharing! Really an awesome post for every one.
Constrained Learned Feature Extraction forAcoustic Scene Classification Project For CSE
Deadline and Buffer Constrained Knapsack Problem Project For CSE
Deep Learning for Recognizing Human Activitiesusing Motions of Skeletal Joints Project For CSE
Fast and Accurate Solution of the Inverse Problem for ImageReconstruction Using Electrical Impedance Tomography Project For CSE
Fault Detection and Isolation in IndustrialProcesses Using Deep Learning Approaches Project For CSE
Gather and Conquer Region based Strategies toAccelerate Safe Screening Tests Project For CSE
Hardware Security Primitive Exploiting IntrinsicVariability in Analog Behavior of 3 D NANDFlash Memory Array Project For CSE
Integration of On line Control in OptimalDesign of Multimode Power split HybridElectric Vehicle Powertrains Project For CSE
Lovely blog...! It is one of the best posts for this topic and I really appreciate your great efforts. Keep continuing...
Placement Training in Chennai
Best placement Training institutes in Chennai
Power BI Training in Chennai
Graphic Design Courses in Chennai
Pega Training in Chennai
Oracle DBA Training in Chennai
Oracle Training in Chennai
Soft Skills Training in Chennai
JMeter Training in Chennai
Tableau Training in Chennai
Appium Training in Chennai
Placement Training in Anna Nagar
Thank you for this informative blog
'CCC Service
AC Service in Chennai
Fridge Service in Chennai
Washing Machine Service in Chennai
LED LCD TV Service in Chennai
Microwave Oven Service in Chennai'
I want to thank for sharing this blog, really great and informative. Share more stuff like this.
Oneyes Technologies
Inplant Training in Chennai
Inplant Training in Chennai for CSE IT MCA
Inplant Training in Chennai ECE EEE EIE
Inplant Training in Chennai for Mechanical
Internship in Chennai
Class ! Saved my day !
This article shares really good content. Very nice to read the article. Keep updating.
Immigration Lawyer Near Me Virginia
Personal Injury Lawyers Near Me Virginia
Bankruptcy Attorney Near Me Virginia