Ask a Question related to Ubuntu, Design and Development.
-
Dean DeBruin #1
cron v anacron
Newbie here, running Ubuntu 5.10.
I understand cron and crontab, but crontab only runs /etc/cron.hourly,
anacrontab runs /etc/cron.daily, /etc/cron.weekly, and /etc/cron.monthly.
At what time does anacron run /etc/cron.daily?
Why doesn't anacron show up when I do ps aux | grep anacron?
Dean DeBruin Guest
-
cron job
If the cron job run every 15 minute, it will fill up mail box. Does anyone has any idea. Thanks "Davide Bianchi" <davideyeahsure@onlyforfun.net>... -
rsh and cron
I have Ultra 60 with Solaris 2.6, and the rsh always work fine, until recently I foud the rsh does not work on the Ultra 60. But I don't have any... -
cron
Not specific to PHP really, but it all started with a simple PHP script I was automating... I've used cron/crontab on a zillion machines, and it... -
CRON: bad user
Hi all, I just noticed the same messages in the cron-log: ! bad user (root) After reading this topic I looked at the shadow-file. I noticed... -
cron log ts=139 errors
In article <bdihf501khu@enews1.newsguy.com>, Scott Shinault <shinault@aracnet.com> wrote: I have always assumed that "ts" stood for "terminated... -
Dean DeBruin #2
Re: cron v anacron
Dean DeBruin wrote:
Does anacron only run at startup? That would explain some things, but> Newbie here, running Ubuntu 5.10.
>
> I understand cron and crontab, but crontab only runs /etc/cron.hourly,
> anacrontab runs /etc/cron.daily, /etc/cron.weekly, and /etc/cron.monthly.
>
> At what time does anacron run /etc/cron.daily?
>
> Why doesn't anacron show up when I do ps aux | grep anacron?
then there are problems with crontab...
Dean DeBruin Guest
-
Toby Newman #3
Re: cron v anacron
On 2006-02-28, Dean DeBruin <deandb@nospam.com> wrote:
You can use cron to run things daily, weekly and monthly.> Newbie here, running Ubuntu 5.10.
>
> I understand cron and crontab, but crontab only runs /etc/cron.hourly,
> anacrontab runs /etc/cron.daily, /etc/cron.weekly, and /etc/cron.monthly.
>
> At what time does anacron run /etc/cron.daily?
>
> Why doesn't anacron show up when I do ps aux | grep anacron?
type
$ crontab -e
to edit your crontab file.
This is a separate thing to the scripts in /etc/cron.* and is more
adaptable to your personal needs, I find.
* * * * * command to be executed
- - - - -
| | | | |
| | | | +----- day of week (0 - 6) (Sunday=0)
| | | +------- month (1 - 12)
| | +--------- day of month (1 - 31)
| +----------- hour (0 - 23)
+------------- min (0 - 59)
--
-Toby, who...
Add the word afiduluminag to the subject
field to circumvent my email filters.
Ignore any mail delivery error.
Toby Newman Guest
-
Dean DeBruin #4
Re: cron v anacron
Toby Newman wrote:
Thank you, I'll look into that.> On 2006-02-28, Dean DeBruin <deandb@nospam.com> wrote:
>>>>Newbie here, running Ubuntu 5.10.
>>
>>I understand cron and crontab, but crontab only runs /etc/cron.hourly,
>>anacrontab runs /etc/cron.daily, /etc/cron.weekly, and /etc/cron.monthly.
>>
>>At what time does anacron run /etc/cron.daily?
>>
>>Why doesn't anacron show up when I do ps aux | grep anacron?
>
> You can use cron to run things daily, weekly and monthly.
>
> type
> $ crontab -e
> to edit your crontab file.
>
> This is a separate thing to the scripts in /etc/cron.* and is more
> adaptable to your personal needs, I find.
>
> * * * * * command to be executed
> - - - - -
> | | | | |
> | | | | +----- day of week (0 - 6) (Sunday=0)
> | | | +------- month (1 - 12)
> | | +--------- day of month (1 - 31)
> | +----------- hour (0 - 23)
> +------------- min (0 - 59)
>
I was trying to run a system-wide daily backup script. I put a link to
it in /etc/cron.daily but it didn't run so I tried to figure out
/etc/crontab.
My /etc/crontab has the following lines:
As far as I can figure out (by reading man pages and by testing)> 17 * * * * root run-parts --report /etc/cron.hourly
> 25 6 * * * root test -x /usr/sbin/anacron || run-parts --report /etc/cron.daily
> 47 6 * * 7 root test -x /usr/sbin/anacron || run-parts --report /etc/cron.weekly
> 52 6 1 * * root test -x /usr/sbin/anacron || run-parts --report /etc/cron.monthly
run-parts runs hourly, but for the daily, weekly, and monthly lines it
will only run if /usr/sbin/anacron does NOT exist! Am I missing something?
/usr/sbin/anacron DOES exist so I removed "test -x /usr/sbin/anacron ||"
from the daily, weekly, and monthly lines and now it seems to work.
Dean DeBruin Guest
-
Toby Newman #5
Re: cron v anacron
On 2006-02-28, Dean DeBruin <deandb@nospam.com> wrote:
Another way would be to type> Toby Newman wrote:>>> On 2006-02-28, Dean DeBruin <deandb@nospam.com> wrote:
>>>>>>>Newbie here, running Ubuntu 5.10.
>>>
>>>I understand cron and crontab, but crontab only runs /etc/cron.hourly,
>>>anacrontab runs /etc/cron.daily, /etc/cron.weekly, and /etc/cron.monthly.
>>>
>>>At what time does anacron run /etc/cron.daily?
>>>
>>>Why doesn't anacron show up when I do ps aux | grep anacron?
>>
>> You can use cron to run things daily, weekly and monthly.
>>
>> type
>> $ crontab -e
>> to edit your crontab file.
>>
>> This is a separate thing to the scripts in /etc/cron.* and is more
>> adaptable to your personal needs, I find.
>>
>> * * * * * command to be executed
>> - - - - -
>> | | | | |
>> | | | | +----- day of week (0 - 6) (Sunday=0)
>> | | | +------- month (1 - 12)
>> | | +--------- day of month (1 - 31)
>> | +----------- hour (0 - 23)
>> +------------- min (0 - 59)
>>
> Thank you, I'll look into that.
>
> I was trying to run a system-wide daily backup script. I put a link to
> it in /etc/cron.daily but it didn't run so I tried to figure out
> /etc/crontab.
>
$ crontab -e
to edit your user's crontab and add the following in order to run a
script at 4am each day:
shell=/bin/sh
MAILTO=yourEmailAddress@invalid.com.invalid
0 4 * * * /path/to/script --AnySwitches
--
-Toby, who...
Add the word afiduluminag to the subject
field to circumvent my email filters.
Ignore any mail delivery error.
Toby Newman Guest
-
SINNER #6
Re: cron v anacron
* Toby Newman wrote in alt.os.linux.ubuntu:
Wont that only run it on Sunday's @ 4?> Another way would be to type
> $ crontab -e
> to edit your user's crontab and add the following in order to run a
> script at 4am each day:
>
> shell=/bin/sh
> MAILTO=yourEmailAddress@invalid.com.invalid
> 0 4 * * * /path/to/script --AnySwitches
--
David
SINNER Guest
-
SINNER #7
Re: cron v anacron
* Toby Newman wrote in alt.os.linux.ubuntu:
never mind...DOH!> Another way would be to type
> $ crontab -e
> to edit your user's crontab and add the following in order to run a
> script at 4am each day:
>
> shell=/bin/sh
> MAILTO=yourEmailAddress@invalid.com.invalid
> 0 4 * * * /path/to/script --AnySwitches
--
David
SINNER Guest
-
Torsten Flammiger #8
Re: cron v anacron
Dean DeBruin schrieb:
[...]> Toby Newman wrote:
-x means:> My /etc/crontab has the following lines:
>>>> 17 * * * * root run-parts --report /etc/cron.hourly
>> 25 6 * * * root test -x /usr/sbin/anacron || run-parts --report
>> /etc/cron.daily
>> 47 6 * * 7 root test -x /usr/sbin/anacron || run-parts --report
>> /etc/cron.weekly
>> 52 6 1 * * root test -x /usr/sbin/anacron || run-parts --report
>> /etc/cron.monthly
>
> As far as I can figure out (by reading man pages and by testing)
> run-parts runs hourly, but for the daily, weekly, and monthly lines it
> will only run if /usr/sbin/anacron does NOT exist! Am I missing something?
>
> /usr/sbin/anacron DOES exist so I removed "test -x /usr/sbin/anacron ||"
> from the daily, weekly, and monthly lines and now it seems to work.
check for the existence AND check wether it is executable
so, if /usr/sbin/anacron exists and is executable it will be executed
otherwise run-parts --report will be executed.
Torsten
Torsten Flammiger Guest
-
Florian Diesch #9
Re: cron v anacron
Dean DeBruin <deandb@nospam.com> wrote:
anacron "cannot currently be used to schedule commands at intervals smaller> Newbie here, running Ubuntu 5.10.
>
> I understand cron and crontab, but crontab only runs /etc/cron.hourly,
> anacrontab runs /etc/cron.daily, /etc/cron.weekly, and /etc/cron.monthly.
than days" as the README.gz says
anacron runs at startup and is executed each morning by cron (see> At what time does anacron run /etc/cron.daily?
>
> Why doesn't anacron show up when I do ps aux | grep anacron?
/etc/crontab). It's not a daemon so it doesn't show up in ps after it
has finished today's work.
Florian
--
Das ist ja das positive am usenet: man erfährt oft Dinge, nach denen
gar nicht gefragt wurde.
[Konrad Wilhelm in <lsght1hho14bbe7in8q9currhtc7vuqfru@4ax.com>]
Florian Diesch Guest
-
Dean DeBruin #10
Re: cron v anacron
Torsten Flammiger wrote:
As far as I can tell, "test -x file"only checks the existence of the> Dean DeBruin schrieb:
>>>>Toby Newman wrote:
>
> [...]
>
>>>>My /etc/crontab has the following lines:
>>
>>>>>>>17 * * * * root run-parts --report /etc/cron.hourly
>>>25 6 * * * root test -x /usr/sbin/anacron || run-parts --report
>>>/etc/cron.daily
>>>47 6 * * 7 root test -x /usr/sbin/anacron || run-parts --report
>>>/etc/cron.weekly
>>>52 6 1 * * root test -x /usr/sbin/anacron || run-parts --report
>>>/etc/cron.monthly
>>
>>As far as I can figure out (by reading man pages and by testing)
>>run-parts runs hourly, but for the daily, weekly, and monthly lines it
>>will only run if /usr/sbin/anacron does NOT exist! Am I missing something?
>>
>>/usr/sbin/anacron DOES exist so I removed "test -x /usr/sbin/anacron ||"
>>from the daily, weekly, and monthly lines and now it seems to work.
>
> -x means:
> check for the existence AND check wether it is executable
>
> so, if /usr/sbin/anacron exists and is executable it will be executed
> otherwise run-parts --report will be executed.
>
> Torsten
file and whether it is executable. It does not execute the file. The
following experiment seems to support that idea.
dean@ubuntu:~$ ls -l ./hello
-rwxr-xr-x 1 dean dean 31 2006-02-28 23:10 ./hello
dean@ubuntu:~$ ./hello
hello, world
dean@ubuntu:~$ test -x ./hello
dean@ubuntu:~$ test -x ./hello || echo goodbye
dean@ubuntu:~$
The above experiment also shows that cron would not execute the daily,
weekly, and monthly lines in /etc/crontab.
Dean DeBruin Guest
-
Dean DeBruin #11
Re: cron v anacron
Florian Diesch wrote:
Yes, I finally figured out that anacron runs at startup and then exits.> Dean DeBruin <deandb@nospam.com> wrote:
>>>>Newbie here, running Ubuntu 5.10.
>>
>>I understand cron and crontab, but crontab only runs /etc/cron.hourly,
>>anacrontab runs /etc/cron.daily, /etc/cron.weekly, and /etc/cron.monthly.
>
> anacron "cannot currently be used to schedule commands at intervals smaller
> than days" as the README.gz says
>
>>>>At what time does anacron run /etc/cron.daily?
>>
>>Why doesn't anacron show up when I do ps aux | grep anacron?
>
> anacron runs at startup and is executed each morning by cron (see
> /etc/crontab). It's not a daemon so it doesn't show up in ps after it
> has finished today's work.
It is not a daemon. However, it is not executed each morning by cron,
nor should it be.
Anacron is intended to run at startup to catch those jobs missed by cron
while the computer is shut down. If cron is running, there is no need
for it to run anacron. I contend that the "test -x /usr/sbin/anacron
||" does not belong in /etc/crontab.
Dean
Dean DeBruin Guest
-
Torsten Flammiger #12
Re: cron v anacron
Dean DeBruin schrieb:
you are right - my mistake.. beat me :-)> Torsten Flammiger wrote:
>>>> Dean DeBruin schrieb:
>>>>>>> Toby Newman wrote:
>>
>>
>> [...]
>>
>>>>>>> My /etc/crontab has the following lines:
>>>
>>>
>>>> 17 * * * * root run-parts --report /etc/cron.hourly
>>>> 25 6 * * * root test -x /usr/sbin/anacron || run-parts --report
>>>> /etc/cron.daily
>>>> 47 6 * * 7 root test -x /usr/sbin/anacron || run-parts --report
>>>> /etc/cron.weekly
>>>> 52 6 1 * * root test -x /usr/sbin/anacron || run-parts --report
>>>> /etc/cron.monthly
>>>
>>>
>>>
>>> As far as I can figure out (by reading man pages and by testing)
>>> run-parts runs hourly, but for the daily, weekly, and monthly lines it
>>> will only run if /usr/sbin/anacron does NOT exist! Am I missing
>>> something?
>>>
>>> /usr/sbin/anacron DOES exist so I removed "test -x /usr/sbin/anacron ||"
>>> from the daily, weekly, and monthly lines and now it seems to work.
>>
>>
>> -x means:
>> check for the existence AND check wether it is executable
>>
>> so, if /usr/sbin/anacron exists and is executable it will be executed
>> otherwise run-parts --report will be executed.
>>
>> Torsten
>
> As far as I can tell, "test -x file"only checks the existence of the
> file and whether it is executable. It does not execute the file. The
Torsten Flammiger Guest
-
Dean DeBruin #13
Re: cron v anacron
Dean DeBruin wrote:
For anyone following this thread, cron and anacron are working properly.> Newbie here, running Ubuntu 5.10.
>
> I understand cron and crontab, but crontab only runs /etc/cron.hourly,
> anacrontab runs /etc/cron.daily, /etc/cron.weekly, and /etc/cron.monthly.
>
> At what time does anacron run /etc/cron.daily?
>
> Why doesn't anacron show up when I do ps aux | grep anacron?
See the bug report: [url]https://launchpad.net/malone/bugs/35617[/url]
Dean DeBruin Guest



Reply With Quote

