Sign up ×
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It's 100% free, no registration required.

I have a python script that I would like to run in every hour.
The cron command look like this:

54 * * * * root python /home/pi/moka/olx_multi.py 2>&1

The script is not running and I always get the same error without any information about the error real reason. The error message look like this:

Feb 22 19:54:01 raspberrypi /USR/SBIN/CRON[30216]: (root) CMD (python /home/pi/moka/olx_multi.py 2>&1)
Feb 22 19:54:01 raspberrypi /USR/SBIN/CRON[30215]: (CRON) info (No MTA installed, discarding output)

Can anyone spot what I'm doing wrong?

share|improve this question
    
The script is probably running. Just the output (stdout and redirected stderr) are discarded as cron is not attached to any shell - no where to output to. – Ghanima Feb 22 at 20:28

2 Answers 2

up vote 0 down vote accepted

You have a few options:

  • Install an MTA and receive all script output in the user's e-mail address: sudo apt-get install postfix. By default the mail will be delivered to a local mailbox in /var/spool/mail/[username]

  • Replace 2>&1 by >/dev/null 2>&1 to ignore the script output

  • Append | logger to send all script output to syslog

share|improve this answer

Does you script work when running manually? If yes, I think you should specify full path to python interpreter:

54 * * * * root /usr/bin/python /home/pi/moka/olx_multi.py 2>&1
share|improve this answer

Your Answer

 
discard

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.