Search code examples
croncron-task

Crontab inactive?


This is my first project with crontab so I am unsure what I am doing wrong

I was under the assumption you wrote something like

0 * * * *  /home/pi/dir/file

But my code is

0,30 * * * * /home/pi/ES/logTemp.py

but nothing appears to be working. I checked

service cond status

and got

cond.service
Loaded: not-found (Reason: no such file or directory)
Active: inactive (dead)

I double checked and I wrote the directory (I think) correctly and that is the name of my file I want to run.

Any tips for a newbie?


Solution

  • You are using correct code to schedule the crontab, just restart the cron and it would work.

    but the command you are executing to check the status is incorrect. i.e. you are using cond instead of crond(service cond status).

    1. You can try the below code.(its same of your code)

    */30 * * * * /home/pi/ES/logTemp.py

    To restart the cron, Run

    service crond restart

    And to check status of cron, Run

    service crond status

    Use sudo if logged in using other username than root