Why are cron.hourly files not running? SOLVED
Larry Alkoff
labradley at mindspring.com
Mon Jul 16 23:56:09 UTC 2007
My cron.hourly file was not running because it was settime.cron
and cron or anacron does not permit a period in the cron file name.
The file is now called settime-cron and all is well.
Whew.
From man run-parts:
Files must conform to the same naming convention as used by
run-parts(8): they must consist solely of upper- and lower-case
letters, digits, underscores, and hyphens.
If the -l option is specified, then they must conform to the LSB
namespace specification, exactly as in the --lsb-sysinit option in
run-parts.
In other words, no periods unless you have the --lsb-sysinit option in
run-parts. My solution is to use permitted hyphens not periods.
Larry
Larry Alkoff wrote:
> Derek Broughton wrote:
>> Larry Alkoff wrote:
>>
>>> What are these entries in /etc/syslog trying to tell me?
>>> Could the printcap entries have something to do with simply writing an
>>> echo statement to a file?
>>>
>>> Jul 16 14:20:01 kinda smbd[12172]: [2007/07/16 14:20:01, 0]
>>> printing/pcap.c:pcap_cache_reload(159)
>>> Jul 16 14:20:01 kinda smbd[12172]: Unable to open printcap file
>>> /etc/printcap for read!
>>> Jul 16 14:20:01 kinda smbd[12172]: [2007/07/16 14:20:01, 0]
>>> printing/pcap.c:pcap_cache_reload(159)
>>> Jul 16 14:20:01 kinda smbd[12172]: Unable to open printcap file
>>> /etc/printcap for read!
>>> Jul 16 14:20:01 kinda /USR/SBIN/CRON[7528]: (root) CMD ( cd / &&
>>> run-parts --report /etc/cron.hourly)
>>
>> Why would you even think that? You have messages from two processes - one
>> (#12172) says it's smbd (the samba daemon), the other (7529) says it's
>> CRON. So you might have a samba problem, but it isn't related to
>> cron.hourly.
>>
>> Since you don't seem to be getting any results from cron.hourly, why don't
>> you start by running the command shown exactly:
>>
>> # sudo su
>> # cd / && run-parts --report /etc/cron.hourly
>>
>> and see what it does.
>>
>> btw, I'm not even sure you can write directly to syslog. Try
>> using "logger".
>
>
> Using your two commands.
> sudo su of course changed to a root user.
> The second line changed to the / directory but did nothing else AFAICS.
>
> Before the command was issued the only thing I saw in /var/log/syslog
> were entries of:
> Jul 16 15:37:39 kinda smbd[12172]: Unable to open printcap file
> /etc/printcap for read!
> Jul 16 15:50:36 kinda smbd[12172]: [2007/07/16 15:50:36, 0]
> printing/pcap.c:pcap_cache_reload(159)
> Jul 16 15:50:36 kinda smbd[12172]: Unable to open printcap file
> /etc/printcap for read!
> Jul 16 15:50:36 kinda smbd[12172]: [2007/07/16 15:50:36, 0]
> printing/pcap.c:pcap_cache_reload(159)
> Jul 16 15:50:36 kinda smbd[12172]: Unable to open printcap file
> /etc/printcap for read!
> Jul 16 16:03:32 kinda smbd[12172]: [2007/07/16 16:03:32, 0]
> printing/pcap.c:pcap_cache_reload(159)
> Jul 16 16:03:32 kinda smbd[12172]: Unable to open printcap file
> /etc/printcap for read!
> Jul 16 16:03:32 kinda smbd[12172]: [2007/07/16 16:03:32, 0]
> printing/pcap.c:pcap_cache_reload(159)
> Jul 16 16:03:32 kinda smbd[12172]: Unable to open printcap file
> /etc/printcap for read!
>
> Whatever printcap has to do with I don't know.
>
> Finally I tested wether or not is is possible to write directly to
> syslog with:
> echo This is a test >>/var/log/syslog
> which produced
> this is a test
> so it seems to be quite possible.
>
> Larry
>
>
A postscript:
Tried logger with
logger This is a test
and indeed it wrote to syslog with a nice date/time stamp.
I put it in my little settime.cron script.
However, at the appointed minute of executing run-parts in
/etc/cron.hourly, the settime.cron script with logger did not run.
/usr/bin/logger is in the path that #!/bin/sh sets up.
Again, I suspect that cron.hourly scripts are treated differently
because the crontab line does not include anacron like the others.
--
Larry Alkoff N2LA - Austin TX
Using Thunderbird on Linux
--
ubuntu-users mailing list
ubuntu-users at lists.ubuntu.com
Modify settings or unsubscribe at:
https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
More information about the ubuntu-users
mailing list