solo2500
Posts: 123
Joined: Sat Jul 09, 2016 12:38 am

cron job?

Sat Aug 06, 2016 5:05 pm

Can anyone tell me if the formatting of this crontab entry is correct?
0 6 * * * /etc/init.d/ service motion start
1 13 * * * /etc/init.d/ service motion stop

I see that it runs. This is what I get from the log file:
Aug 6 13:01:01 VIDraspberrypi CRON[1083]: (root) CMD (/etc/init.d/ service motion stop)

But Motion does not stop? It's got to be something simple but I'm to dense to figure it out... Any ideas.
THANKS for any help!
I'm a total novice, non-programer (...basically a hack.)

stderr
Posts: 2178
Joined: Sat Dec 01, 2012 11:29 pm

Re: cron job?

Sat Aug 06, 2016 5:18 pm

solo2500 wrote:But Motion does not stop?
Does it stop when you use that command at the command line? Does it require root privileges? Are you using a normal user crontab or root's?

solo2500
Posts: 123
Joined: Sat Jul 09, 2016 12:38 am

Re: cron job?

Sat Aug 06, 2016 5:33 pm

stderr wrote:
solo2500 wrote:But Motion does not stop?
Does it stop when you use that command at the command line? Does it require root privileges? Are you using a normal user crontab or root's?
Yes... When I use sudo service motion stop at the command prompt it stops. The cron job is in the root.. ie sudo cron -e
I'm a total novice, non-programer (...basically a hack.)

User avatar
rpdom
Posts: 17174
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: cron job?

Sat Aug 06, 2016 5:37 pm

solo2500 wrote:
stderr wrote:
solo2500 wrote:But Motion does not stop?
Does it stop when you use that command at the command line? Does it require root privileges? Are you using a normal user crontab or root's?
Yes... When I use sudo service motion stop at the command prompt it stops. The cron job is in the root.. ie sudo cron -e
But your crontab isn't running "service motion stop". It's running "/etc/init.d/ service motion stop", which is not a valid command.

Try

Code: Select all

0 6 * * * /usr/sbin/service motion start
1 13 * * * /usr/sbin/service motion stop

solo2500
Posts: 123
Joined: Sat Jul 09, 2016 12:38 am

Re: cron job?

Sat Aug 06, 2016 5:48 pm

THANK YOU... THANK YOU.... THANK YOU!!!

I love you... man!

I just started learning Pi and linux! The depth of my ignorance seems infinite! Thanks again!
I'm a total novice, non-programer (...basically a hack.)

Return to “Beginners”