Max Frai
Max Frai

Reputation: 64266

Crontab and script

I have debian linux. I've created from user crontab -e this text:

0   * * * * python /home/user/CronLogic.py
15  * * * * python /home/user/CronLogic.py
30  * * * * python /home/user/CronLogic.py
45  * * * * python /home/user/CronLogic.py

*/1 * * * * date > /tmp/TEST

Last string runs fine but running python script fails with:

/bin/sh: 1: /usr/bin/rcssserver: not found

The code is:

#!/usr/bin/python
cmd ='/usr/bin/rcssserver'
err = open('CronLogicERRORS', 'a')
server = subprocess.Popen(cmdRes, shell=True, stderr=err)

And the error appears in CronLogicERRORS file. What could be wrong here? Without cron script runs fine.

Upvotes: 2

Views: 246

Answers (1)

Kevin
Kevin

Reputation: 56049

cmd ='/usr/bin/rcssserver'
#                ^^^ Too many s's

Now, about your cron usage:

Instead of having the same line 4 times, make it one line of 0,15,30,45, or even better */15. And your */1 is redundant, just plain * is better.

Upvotes: 4

Related Questions