0

I want to run the following command for cron job

python test.py -sau 0 -bg 200000 -t mcs3245 > g2g.log

I have setup a cron job like below

5 0 * * * /local/mnt/workspace/username/scripts/python test.py -sau 0 -bg 200000 -t mcs3245 > g2g.log 

am getting the following error

/bin/sh: /local/mnt/workspace/username/scripts/python: No such file or directory

Can anyonehelp on what is wrong and how to set this up?

user1927396
  • 449
  • 1
  • 9
  • 21

1 Answers1

0

Unless /local/mnt/workspace/username/scripts/ is the directory of your python installation I would suggest something like this:

5 0 * * * /usr/bin/python /path/to/script/test.py -sau 0 -bg 200000 -t mcs3245 > g2g.log

If you want to execute the script as user USERNAME:

5 0 * * * USERNAME /usr/bin/python /path/to/script/test.py -sau 0 -bg 200000 -t mcs3245 > g2g.log

Found that last one here on superuser.com.

Community
  • 1
  • 1
Sander
  • 3,942
  • 2
  • 17
  • 22