FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian User

 
 
LinkBack Thread Tools
 
Old 05-05-2012, 10:26 PM
Tony Baldwin
 
Default cron job not executing

I've got a little cron job,
just trying to fire off a script (see http://tonyb.us/mattbot )
and it's not firing.

I have other jobs on the same crontab that do.
When I run the script manually, it runs.

I've tried, in my user crontab
0 * * * * /path/to/script
or
@hourly /path/to/script
or
0 * * * * cd /path/to/ ./script
and even stuck a script in
/etc/cron.hourl with
#!/bin/bash
cd /path/to/
./script

and none of these has made the script run.

I have another in my user script
05 2 * * * /path/to/another/script
and it works every morning at 2:05am, like clockwork,
so I can't figure why this new one isn't working.
Permissions on both scripts are the same, etc.

Now, I've also added a script to /usr/local/bin
with the cd /path/to
./script

and tried to tell cron to run that script with
0 * * * /usr/local/bin/script
I'll have to wait another 35 min., now, to see if that works,
but I can't figure out for the life of me why none of the other methods
worked.

??

Probably something really obvious I'm overlooking, but the more I look,
the less I see why there's a problem.

any and all assistance appreciated in advance

./tony
--
http://www.tonybaldwin.me
all tony, all the time!
3F330C6E
 
Old 05-05-2012, 11:07 PM
Adrian Fita
 
Default cron job not executing

On 06/05/12 01:26, Tony Baldwin wrote:
> I've got a little cron job,
> just trying to fire off a script (see http://tonyb.us/mattbot )
> and it's not firing.

[...]

> Probably something really obvious I'm overlooking, but the more I look,
> the less I see why there's a problem.
>
> any and all assistance appreciated in advance

Have you tried looking at the cron log to check and see if the script is
firing? You might have to enable the cron log if there is no log from
cron (check here: [1]).

1. http://happy-coding.com/enable-crontab-logging-in-debian-linux/

--
Fita Adrian


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 4FA5B29C.8050109@gmail.com">http://lists.debian.org/4FA5B29C.8050109@gmail.com
 
Old 05-06-2012, 03:06 AM
Patrick Wiseman
 
Default cron job not executing

On Sat, May 5, 2012 at 6:26 PM, Tony Baldwin <tony@tonybaldwin.org> wrote:
> I've got a little cron job,
> just trying to fire off a script (see http://tonyb.us/mattbot )
> and it's not firing.
>
> I have other jobs on the same crontab that do.
> When I run the script manually, it runs.

[...]

> Probably something really obvious I'm overlooking, but the more I look,
> the less I see why there's a problem.

In my experience with cron jobs it's either permissions or path.
Permissions you said are OK, so I'd put a PATH statement in your
script (I notice it has none), which includes a path to your script
and any programs it calls. Cron jobs operate with a very lean
environment, so the fact it works when you run it from the command
line is no guarantee it will run as a cron job.

Patrick


--
To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: CAJVvKsPPwiydV=tW0H_qNH+8ZaC8mGbYbqkD09_UV+wC1rxN0 Q@mail.gmail.com">http://lists.debian.org/CAJVvKsPPwiydV=tW0H_qNH+8ZaC8mGbYbqkD09_UV+wC1rxN0 Q@mail.gmail.com
 

Thread Tools




All times are GMT. The time now is 02:19 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org