Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Operating system Linux 2.6.18-028stab089.1
Parallels Plesk Panel version 9.5.4

Set up a test cron job in Settings>Scheduled Tasks>user "root">
* * * * * /var/www/cron/ >/dev/null 2>&1
The script contains this:

echo "test" >>/var/www/cron/webcrontest.log

However, nothing gets output in that file.
How could I find out what's the problem? I have no access to the e-mail that the cron jobs could be sent to (not my host, trying to set up a cron job for a client because he doesn't listen when I say it's the sysadmins job).

share|improve this question
up vote 0 down vote accepted

You are discarding any diagnostic information you might have by sending stdout & stderr to /dev/null (>/dev/null 2>&1).

Try redirecting the output to a file and seeing what it contains

* * * * * /var/www/cron/ &>/tmp/webcrontest.out

Which will write stdout and stderr to /tmp/webcrontest.out.

Edit: From the comments, you have DOS line endings, use dos2unix to remove the ^M line endings

dos2unix /var/www/cron/ 
share|improve this answer
Ok, I got this: /bin/sh: /var/www/cron/ /bin/sh^M: bad interpreter: No such file or directory What can I do about it? Edit: changed to /bin/bash, will see if it helps any. Edit2: /bin/bash - same thing. – jurchiks Aug 11 '11 at 14:04
Use a linux editor to edit the file. You'll probably see ^M at the end of each line, remove them. Is this a file that you edited on windows and uploaded ? – Iain Aug 11 '11 at 14:07
Just edited it with Notepad++, changed EOL and it works now. I'll test it with some more stuff. – jurchiks Aug 11 '11 at 14:11
Yeah, that works too. lots of solutions when you know what the problem is ;) – Iain Aug 11 '11 at 14:16
Well, everything works now, thanks for help :) – jurchiks Aug 11 '11 at 14:25
dos2unix /var/www/cron/
share|improve this answer
EOL>Unix format, UTF-8 without BOM... what do I need to convert there? – jurchiks Aug 11 '11 at 14:09

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.