Re: [gentoo-user] script in /etc/cron.daily never runs

2005-09-22 Thread Matt Randolph

Dave Nebinger wrote:


Also, check that the environment in the cron script is correct. It does
not execute with the environment that you sit down at a terminal 
with, in particular $PATH.



Another tip RE: environment variables  cron, if you submit the job 
via at (sys-process/at), it will create an executable script in 
/var/spool/at/atjobs for running your submitted job, but the script 
includes the environment values from the session used to submit the job.


So after submission via at, you can take the atjob file, copy it to 
your /etc/cron.* directory and you'll have everything you need 
regarding environment.


Dave



Thank you for the suggestion.  I'll have to experiment with this.

Matt
--
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] script in /etc/cron.daily never runs

2005-09-22 Thread Matt Randolph

Renat Golubchyk wrote:


On Wed, 21 Sep 2005 16:15:04 -0500 John Jolet [EMAIL PROTECTED] wrote:
 


On Wed, 2005-09-21 at 17:11 -0400, Matt Randolph wrote:
   


I have a script in /etc/cron.daily that never runs.  It works
properly when run manually and it's been in there for weeks (and a
reboot or two).

I'm using vixie-cron.
 



Is the executable bit set? Otherwise run chmod u+x scriptname.

 


cron.daily doesn't get run from cron.  gets run out of anacrondo
you have anacron installed?
   



That's wrong. I don't have anacron installed, I have plain vixie-cron,
and cron.{hourly,daily,weekly,monthly} gets run from cron. Here are the
relevant lines from /etc/crontab:

# check scripts in cron.hourly, cron.daily, cron.weekly and cron.monthly
0* * * *  root  rm -f /var/spool/cron/lastrun/cron.hourly
30   6 * * *  root  rm -f /var/spool/cron/lastrun/cron.daily
15   7 * * 6  root  rm -f /var/spool/cron/lastrun/cron.weekly
08 1 * *  root  rm -f /var/spool/cron/lastrun/cron.monthly
*/10 * * * *  root  test -x /usr/sbin/run-crons  /usr/sbin/run-crons


Cheers,
Renat

 



Thanks to everyone for their replies, but especially to Renat, Peter and 
Willie.  Looking again, I saw that the line pertaining to run-crons was 
commented out.  Perhaps it's time for me to increase the size of my 
console font.  ;-)


Matt
--
gentoo-user@gentoo.org mailing list



[gentoo-user] script in /etc/cron.daily never runs

2005-09-21 Thread Matt Randolph
I have a script in /etc/cron.daily that never runs.  It works properly 
when run manually and it's been in there for weeks (and a reboot or two).


I'm using vixie-cron.

Anyone have any ideas?

Thanks,

Matt

--
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] script in /etc/cron.daily never runs

2005-09-21 Thread John Jolet
On Wed, 2005-09-21 at 17:11 -0400, Matt Randolph wrote:
 I have a script in /etc/cron.daily that never runs.  It works properly 
 when run manually and it's been in there for weeks (and a reboot or two).
 
 I'm using vixie-cron.
cron.daily doesn't get run from cron.  gets run out of anacrondo you
have anacron installed?

-- 
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] script in /etc/cron.daily never runs

2005-09-21 Thread Renat Golubchyk
On Wed, 21 Sep 2005 16:15:04 -0500 John Jolet [EMAIL PROTECTED] wrote:
 On Wed, 2005-09-21 at 17:11 -0400, Matt Randolph wrote:
  I have a script in /etc/cron.daily that never runs.  It works
  properly when run manually and it's been in there for weeks (and a
  reboot or two).
  
  I'm using vixie-cron.

Is the executable bit set? Otherwise run chmod u+x scriptname.

 cron.daily doesn't get run from cron.  gets run out of anacrondo
 you have anacron installed?

That's wrong. I don't have anacron installed, I have plain vixie-cron,
and cron.{hourly,daily,weekly,monthly} gets run from cron. Here are the
relevant lines from /etc/crontab:

# check scripts in cron.hourly, cron.daily, cron.weekly and cron.monthly
0* * * *  root  rm -f /var/spool/cron/lastrun/cron.hourly
30   6 * * *  root  rm -f /var/spool/cron/lastrun/cron.daily
15   7 * * 6  root  rm -f /var/spool/cron/lastrun/cron.weekly
08 1 * *  root  rm -f /var/spool/cron/lastrun/cron.monthly
*/10 * * * *  root  test -x /usr/sbin/run-crons  /usr/sbin/run-crons


Cheers,
Renat

-- 
Probleme kann man niemals mit derselben Denkweise loesen,
durch die sie entstanden sind.
  (Einstein)


pgpHlnKLCGD3z.pgp
Description: PGP signature


Re: [gentoo-user] script in /etc/cron.daily never runs

2005-09-21 Thread John Jolet
On Wed, 2005-09-21 at 22:47 +0100, Peter Ruskin wrote:
 On Wednesday 21 September 2005 22:15, John Jolet wrote:
  On Wed, 2005-09-21 at 17:11 -0400, Matt Randolph wrote:
   I have a script in /etc/cron.daily that never runs.  It works
   properly when run manually and it's been in there for weeks
   (and a reboot or two).
  
   I'm using vixie-cron.
 
  cron.daily doesn't get run from cron.  gets run out of
  anacrondo you have anacron installed?
 
 Not true, cron.daily runs from vixie-cron.
 
Obviously, I stand corrected.  Leftover redhat instincts :)
 /etc/crontab should contain:
 # check scripts in cron.hourly, cron.daily, cron.weekly and 
 cron.monthly
 0  *  * * *   rootrm -f /var/spool/cron/lastrun/cron.hourly
 0  1  * * *   rootrm -f /var/spool/cron/lastrun/cron.daily
 15 0  * * 6   rootrm -f /var/spool/cron/lastrun/cron.weekly
 30 0  1 * *   rootrm -f /var/spool/cron/lastrun/cron.monthly
 */10  *  * * *roottest -x /usr/sbin/run-crons 
  /usr/sbin/run-crons 
 
 -- 
 Peter
 
 Gentoo Linux: Portage 2.0.51.22-r2.   kernel-2.6.13-gentoo-r1.
 i686 AMD Athlon(tm) XP 3200+. gcc(GCC): 3.3.5-20050130.
 KDE: 3.4.2.   Qt: 3.3.4.
 

-- 
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] script in /etc/cron.daily never runs

2005-09-21 Thread Neil Bothwick
On Wed, 21 Sep 2005 17:11:33 -0400, Matt Randolph wrote:

 I have a script in /etc/cron.daily that never runs.  It works properly 
 when run manually and it's been in there for weeks (and a reboot or
 two).

Does it not run or run and not do anything? The latter can be a path
problem, as the cron tasks are not run with the same environment as your
shell. If in doubt, do source /etc/profile at the start of the script.

As someone else said, make sure you chmod +x the script too.


-- 
Neil Bothwick

MS-DOS: if you believe in a flat Earth, this is the OS for you.


pgpvNuJtk9Yr0.pgp
Description: PGP signature


Re: [gentoo-user] script in /etc/cron.daily never runs

2005-09-21 Thread Willie Wong
On Wed, Sep 21, 2005 at 04:15:04PM -0500, John Jolet wrote:
 On Wed, 2005-09-21 at 17:11 -0400, Matt Randolph wrote:
  I have a script in /etc/cron.daily that never runs.  It works properly 
  when run manually and it's been in there for weeks (and a reboot or two).
  
  I'm using vixie-cron.
 cron.daily doesn't get run from cron.  gets run out of anacrondo you
 have anacron installed?

I am not quite sure that is correct. 

I run vixie-cron on my desktop machine, and /etc/crontab, which
vixie-cron respects, has by default the following in it:
snip of /etc/crontab
# check scripts in cron.hourly, cron.daily, cron.weekly and
# cron.monthly
0  *  * * * rootrm -f /var/spool/cron/lastrun/cron.hourly
1  3  * * * rootrm -f /var/spool/cron/lastrun/cron.daily
15 4  * * 6 rootrm -f /var/spool/cron/lastrun/cron.weekly
30 5  1 * * rootrm -f /var/spool/cron/lastrun/cron.monthly
*/10  *  * * *  roottest -x /usr/sbin/run-crons  /usr/sbin/run-crons
end snip
and if you read /usr/sbin/run-crons (just a shell script) you'd see
that it runs the jobs in /etc/cron.$BASE 

Now, it could be quite possible that the OPs system doesn't have such
in /etc/crontab, or it could be missing /usr/sbin/run-crons, in which
case the cron.* directory will not get executed. But AFAIK, a default
gentoo installation of vixie-cron should respect the /etc/cron.*

W
-- 
Optical mice are considered eunuchs hardware because they lack balls.
Sortir en Pantoufles: up 41 days,  1:10
-- 
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] script in /etc/cron.daily never runs

2005-09-21 Thread Dave Nebinger

I have a script in /etc/cron.daily that never runs.  It works properly
when run manually and it's been in there for weeks (and a reboot or two).

I'm using vixie-cron.


cron.daily doesn't get run from cron.  gets run out of anacrondo you
have anacron installed?


Sorry, John, that's not quite right.  Vixie cron should handle the 
/etc/cron.* directories automatically.


Fcron, what I'm using, does not and requires additions to root's crontab to 
get them to work.


To the OP, is a) vixie cron actually running, b) the scripts in the 
directories have the execution permissions, and c) any output in the log 
files indicating why vixie cron might not be executing them?


--
gentoo-user@gentoo.org mailing list



Re: [gentoo-user] script in /etc/cron.daily never runs

2005-09-21 Thread Nick Rout

On Wed, 21 Sep 2005 20:15:35 -0400
Dave Nebinger wrote:

  I have a script in /etc/cron.daily that never runs.  It works properly
  when run manually and it's been in there for weeks (and a reboot or two).
 
  I'm using vixie-cron.
 
  cron.daily doesn't get run from cron.  gets run out of anacrondo you
  have anacron installed?
 
 Sorry, John, that's not quite right.  Vixie cron should handle the 
 /etc/cron.* directories automatically.
 
 Fcron, what I'm using, does not and requires additions to root's crontab to 
 get them to work.
 
 To the OP, is a) vixie cron actually running, b) the scripts in the 
 directories have the execution permissions, and c) any output in the log 
 files indicating why vixie cron might not be executing them?


Also, check that the environment in the cron script is correct. It does
not execute with the environment that you sit down at a terminal with, in 
particular $PATH. The easiest way is to use the complete path to
executables in the file, like 

/bin/mail

instead of

mail



 
 -- 
 gentoo-user@gentoo.org mailing list

-- 
Nick Rout [EMAIL PROTECTED]

-- 
gentoo-user@gentoo.org mailing list