Results 1 to 3 of 3

Thread: Python + crontab

  1. #1
    Join Date
    Apr 2005
    Beans
    18

    Python + crontab

    Hi All,
    I've written a program which is in /home/fox/log.py, and i want to execute it at 10:30 am.
    The program checks some system statistics like uptime, and creates a log file called system.log, in the directory where the log.py file is.
    in my crontab (crontab -e), i have:
    Code:
    30 10  * * * /home/fox/log.py
    the python code is executed ok, but the log file isn't created. (it is if i execute it manually though).

    Any ideas how to get it working? i've tried writing a bash script:
    Code:
    #!/usr/bin/python /home/fox/log.py
    setting it executable, and running that from cron. but i get the same results.

    help please!

    thanks for reading.

  2. #2
    Join Date
    Dec 2004
    Location
    Madison
    Beans
    71
    Distro
    Ubuntu 7.04 Feisty Fawn

    Re: Python + crontab

    I think that the python code uses relative path for the log file and you are unable to locate it. It should work otherwise.

    Regards
    Badri

  3. #3
    Join Date
    Nov 2004
    Beans
    2,614

    Re: Python + crontab

    To clarify what he said, if you're using a relative path for the script output, it's not being output where you think it is.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •