* Cronjobs
@ 2003-07-30 7:34 Tom Troonbeeckx
2003-07-30 7:44 ` Cronjobs César Soler
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Tom Troonbeeckx @ 2003-07-30 7:34 UTC (permalink / raw)
To: linux-admin
Dear Sir/Madam,
I have some proplem with mine cronjobs.
I edit mine /etc/crontab with the following command "crontab -e".
The crontab looks like this
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/
# run-parts
01 * * * * root run-parts /etc/cron.hourly
01 0 * * * root run-parts /etc/cron.daily
30 14 * * * root run-parts /etc/cron.twice.a.day
30 18 * * * root run-parts /etc/cron.twice.a.day
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly
3,18,33,48 * * * * root run-parts /etc/cron.quarter-hourly
1,6,11,16,21,26,31,36,41,46,51,56 * * * * root run-parts /etc/cron.5-min
I restarted the anacron-daemon. I tested the cronjobs individually and they
work fine.
However, since I scheduled them I receive an email after each 5 and 15
minutes with the message
/bin/bash: root: command not found
I figured out that the crondaemon is trying to execute the command root. At
some point it doesn't count the userprivilege of the cronjob.
The configuration looks in mine opinion fine. Any ideas what went wrong?
Thanks in advance....
Ideaxis nv
-facing the internet-
Flanders Multimedia Valley
Wetenschapspark 1
B-3590 DIEPENBEEK
Tel : +32 11 26 89 20
Fax : +32 11 23 22 17
Mobile: +32 479 13 14 81
E-Mail: tom.troonbeeckx@ideaxis.com
URL: http://www.ideaxis.com/
Ideaxis nv legal disclaimer
The information contained in this e-mail is confidential and may be
privileged. It may be read, copied and used only by the intended recipient.
If you have received it in error, please contact the sender immediately by
returning this e-mail. Please delete this e-mail and do not disclose its
contents to any person. Ideaxis nv does not accept liability for any
errors, omissions, delays of receipt or viruses in the contents of this
message which arise as a result of e-mail transmission.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Cronjobs
2003-07-30 7:34 Cronjobs Tom Troonbeeckx
@ 2003-07-30 7:44 ` César Soler
2003-07-30 7:59 ` Cronjobs Vladimír Dvoøák
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: César Soler @ 2003-07-30 7:44 UTC (permalink / raw)
To: Tom Troonbeeckx; +Cc: linux-admin
Hi Tom,
TT> I restarted the anacron-daemon. I tested the cronjobs individually and they
TT> work fine.
TT> However, since I scheduled them I receive an email after each 5 and 15
TT> minutes with the message
TT> /bin/bash: root: command not found
It seems the daemon can not execute the bash shell, is the bash shell
there, in the /bin directory? perhaps $PATH does not include the
/bin directory?...
hope this help you...
TT> Ideaxis nv
TT> -facing the internet-
TT> Flanders Multimedia Valley
TT> Wetenschapspark 1
TT> B-3590 DIEPENBEEK
TT> Tel : +32 11 26 89 20
TT> Fax : +32 11 23 22 17
TT> Mobile: +32 479 13 14 81
TT> E-Mail: tom.troonbeeckx@ideaxis.com
TT> URL: http://www.ideaxis.com/
TT> Ideaxis nv legal disclaimer
TT> The information contained in this e-mail is confidential and may be
TT> privileged. It may be read, copied and used only by the intended recipient.
TT> If you have received it in error, please contact the sender immediately by
TT> returning this e-mail. Please delete this e-mail and do not disclose its
TT> contents to any person. Ideaxis nv does not accept liability for any
TT> errors, omissions, delays of receipt or viruses in the contents of this
TT> message which arise as a result of e-mail transmission.
TT> -
TT> To unsubscribe from this list: send the line "unsubscribe linux-admin" in
TT> the body of a message to majordomo@vger.kernel.org
TT> More majordomo info at http://vger.kernel.org/majordomo-info.html
--
Best regards,
César mailto:csoler@euskalnet.net
-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Cronjobs
2003-07-30 7:34 Cronjobs Tom Troonbeeckx
2003-07-30 7:44 ` Cronjobs César Soler
@ 2003-07-30 7:59 ` Vladimír Dvoøák
2003-07-30 8:17 ` Cronjobs Horia Chirculescu
2003-07-30 8:05 ` Cronjobs Stefan Wimmer
2003-07-30 8:13 ` Cronjobs Scott Taylor
3 siblings, 1 reply; 7+ messages in thread
From: Vladimír Dvoøák @ 2003-07-30 7:59 UTC (permalink / raw)
To: Tom Troonbeeckx; +Cc: linux-admin
Hi Tom,
>I have some proplem with mine cronjobs.
>
>I edit mine /etc/crontab with the following command "crontab -e".
>The crontab looks like this
>
>SHELL=/bin/bash
>PATH=/sbin:/bin:/usr/sbin:/usr/bin
>MAILTO=root
>HOME=/
>
># run-parts
>01 * * * * root run-parts /etc/cron.hourly
>01 0 * * * root run-parts /etc/cron.daily
>30 14 * * * root run-parts /etc/cron.twice.a.day
>30 18 * * * root run-parts /etc/cron.twice.a.day
>22 4 * * 0 root run-parts /etc/cron.weekly
>42 4 1 * * root run-parts /etc/cron.monthly
>3,18,33,48 * * * * root run-parts /etc/cron.quarter-hourly
>1,6,11,16,21,26,31,36,41,46,51,56 * * * * root run-parts /etc/cron.5-min
>
>I restarted the anacron-daemon. I tested the cronjobs individually and they
>work fine.
>However, since I scheduled them I receive an email after each 5 and 15
>minutes with the message
> /bin/bash: root: command not found
>
>
Isnt better to use :
1-56/5 * * * * root run-parts /etc/cron.5-min
or
*/5 * * * * .....
( I havent try that, but accorning to man page, it would work. )
vd, IT Admin of SuSE CR
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Cronjobs
2003-07-30 7:34 Cronjobs Tom Troonbeeckx
2003-07-30 7:44 ` Cronjobs César Soler
2003-07-30 7:59 ` Cronjobs Vladimír Dvoøák
@ 2003-07-30 8:05 ` Stefan Wimmer
2003-07-30 10:16 ` Cronjobs Andrew Kelly
2003-07-30 8:13 ` Cronjobs Scott Taylor
3 siblings, 1 reply; 7+ messages in thread
From: Stefan Wimmer @ 2003-07-30 8:05 UTC (permalink / raw)
To: Tom Troonbeeckx; +Cc: linux-admin
* Tom Troonbeeckx <tom.troonbeeckx@ideaxis.com> wrote on 30/Jul/2003 - 09:34:38 :
> Dear Sir/Madam,
>
> I have some proplem with mine cronjobs.
>
> I edit mine /etc/crontab with the following command "crontab -e".
> The crontab looks like this
>
> SHELL=/bin/bash
> PATH=/sbin:/bin:/usr/sbin:/usr/bin
> MAILTO=root
> HOME=/
>
> # run-parts
> 01 * * * * root run-parts /etc/cron.hourly
> 01 0 * * * root run-parts /etc/cron.daily
> 30 14 * * * root run-parts /etc/cron.twice.a.day
> 30 18 * * * root run-parts /etc/cron.twice.a.day
> 22 4 * * 0 root run-parts /etc/cron.weekly
> 42 4 1 * * root run-parts /etc/cron.monthly
> 3,18,33,48 * * * * root run-parts /etc/cron.quarter-hourly
> 1,6,11,16,21,26,31,36,41,46,51,56 * * * * root run-parts /etc/cron.5-min
>
> I restarted the anacron-daemon. I tested the cronjobs individually and they
> work fine.
> However, since I scheduled them I receive an email after each 5 and 15
> minutes with the message
> /bin/bash: root: command not found
>
> I figured out that the crondaemon is trying to execute the command root. At
> some point it doesn't count the userprivilege of the cronjob.
>
> The configuration looks in mine opinion fine. Any ideas what went wrong?
>
> Thanks in advance....
By using "crontab -e" you're editing your personal cron file (located in
/var/spool/cron in RedHat) and there you don't need the user who is
running the commands ... so leaving out "root" from your lines should help.
old: 3,18,33,48 * * * * root run-parts /etc/cron.quarter-hourly
new: 3,18,33,48 * * * * run-parts /etc/cron.quarter-hourly
By the way - if you want some jobs running every 15 minutes you can use the syntax
old: 3,18,33,48 * * * * root run-parts /etc/cron.quarter-hourly
new: */15 * * * * run-parts /etc/cron.quarter-hourly
as well (I have to admit that I don't know adhoc how you can start it at
the third minute ;-} ).
Hope this helps
Stefan
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Cronjobs
2003-07-30 7:34 Cronjobs Tom Troonbeeckx
` (2 preceding siblings ...)
2003-07-30 8:05 ` Cronjobs Stefan Wimmer
@ 2003-07-30 8:13 ` Scott Taylor
3 siblings, 0 replies; 7+ messages in thread
From: Scott Taylor @ 2003-07-30 8:13 UTC (permalink / raw)
To: linux-admin
Tom Troonbeeckx said:
> Dear Sir/Madam,
>
> I have some proplem with mine cronjobs.
>
> I edit mine /etc/crontab with the following command "crontab -e".
> The crontab looks like this
> 3,18,33,48 * * * * root run-parts /etc/cron.quarter-hourly
> 1,6,11,16,21,26,31,36,41,46,51,56 * * * * root run-parts
> /etc/cron.5-min
>
> However, since I scheduled them I receive an email after each 5 and 15
> minutes with the message
> /bin/bash: root: command not found
Curious, see what happens if you change the names of those files with
"-" in them, maybe anacron is parsing those dashes. change them to
"."
mv /etc/cron.5-min /etc/cron.5.min
etc
And change those lines in the crontab file.
--
Scott
long .signature files are annoying
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Cronjobs
2003-07-30 7:59 ` Cronjobs Vladimír Dvoøák
@ 2003-07-30 8:17 ` Horia Chirculescu
0 siblings, 0 replies; 7+ messages in thread
From: Horia Chirculescu @ 2003-07-30 8:17 UTC (permalink / raw)
To: Vladimír Dvoøák; +Cc: Tom Troonbeeckx, linux-admin
The problem that you face is that crond does not have to deal with suid.
I think that you want to run the script "run-parts" suid as root. You did
it wrong, editing the crontab for a common user (you), adding the magic
word "root" and hopping that this will do the job.
You must edit the crontab for root, keep the sintax that you allready
have or the sintax that vd suggested, omitting "root".
If your script does not need root privileges, it is better to run it as a
normal user. This involves SECURITY.
Have a nice day from Romania!
____ ____ o ~
// // / __ \ // \ // //'''' //\\
//_____// / / / / //___ / // // // \\
// // / /_/ / // \ // // //____\\
// // \____/ // \ // \\.... // \\
------------------------------------------------------------------------
Comtec Net Romania
----------------------------------------------------
WEB: www.eltop.ro IRC: irc.eltop.ro NEWS: news.eltop.ro
----------------------------------------------------
Horia Chirculescu root@eltop.ro
Connex: +40 723 205 086
Zapp: +40 788 374 059
On Wed, 30 Jul 2003, [ISO-8859-1] Vladimír Dvoøák wrote:
> Hi Tom,
>
> >I have some proplem with mine cronjobs.
> >
> >I edit mine /etc/crontab with the following command "crontab -e".
> >The crontab looks like this
> >
> >SHELL=/bin/bash
> >PATH=/sbin:/bin:/usr/sbin:/usr/bin
> >MAILTO=root
> >HOME=/
> >
> ># run-parts
> >01 * * * * root run-parts /etc/cron.hourly
> >01 0 * * * root run-parts /etc/cron.daily
> >30 14 * * * root run-parts /etc/cron.twice.a.day
> >30 18 * * * root run-parts /etc/cron.twice.a.day
> >22 4 * * 0 root run-parts /etc/cron.weekly
> >42 4 1 * * root run-parts /etc/cron.monthly
> >3,18,33,48 * * * * root run-parts /etc/cron.quarter-hourly
> >1,6,11,16,21,26,31,36,41,46,51,56 * * * * root run-parts /etc/cron.5-min
> >
> >I restarted the anacron-daemon. I tested the cronjobs individually and they
> >work fine.
> >However, since I scheduled them I receive an email after each 5 and 15
> >minutes with the message
> > /bin/bash: root: command not found
> >
> >
> Isnt better to use :
>
> 1-56/5 * * * * root run-parts /etc/cron.5-min
>
> or
>
> */5 * * * * .....
> ( I havent try that, but accorning to man page, it would work. )
>
> vd, IT Admin of SuSE CR
>
>
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-admin" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Cronjobs
2003-07-30 8:05 ` Cronjobs Stefan Wimmer
@ 2003-07-30 10:16 ` Andrew Kelly
0 siblings, 0 replies; 7+ messages in thread
From: Andrew Kelly @ 2003-07-30 10:16 UTC (permalink / raw)
To: linux-admin
Stefan Wimmer wrote:
>
> * Tom Troonbeeckx <tom.troonbeeckx@ideaxis.com> wrote on 30/Jul/2003 - 09:34:38 :
> > Dear Sir/Madam,
> >
> > I have some proplem with mine cronjobs.
> >
> > I edit mine /etc/crontab with the following command "crontab -e".
> > The crontab looks like this
> >
> > SHELL=/bin/bash
> > PATH=/sbin:/bin:/usr/sbin:/usr/bin
> > MAILTO=root
> > HOME=/
> >
> > # run-parts
> > 01 * * * * root run-parts /etc/cron.hourly
> > 01 0 * * * root run-parts /etc/cron.daily
> > 30 14 * * * root run-parts /etc/cron.twice.a.day
> > 30 18 * * * root run-parts /etc/cron.twice.a.day
> > 22 4 * * 0 root run-parts /etc/cron.weekly
> > 42 4 1 * * root run-parts /etc/cron.monthly
> > 3,18,33,48 * * * * root run-parts /etc/cron.quarter-hourly
> > 1,6,11,16,21,26,31,36,41,46,51,56 * * * * root run-parts /etc/cron.5-min
> >
> > I restarted the anacron-daemon. I tested the cronjobs individually and they
> > work fine.
> > However, since I scheduled them I receive an email after each 5 and 15
> > minutes with the message
> > /bin/bash: root: command not found
> >
> > I figured out that the crondaemon is trying to execute the command root. At
> > some point it doesn't count the userprivilege of the cronjob.
> >
> > The configuration looks in mine opinion fine. Any ideas what went wrong?
> >
> > Thanks in advance....
>
> By using "crontab -e" you're editing your personal cron file (located in
> /var/spool/cron in RedHat) and there you don't need the user who is
> running the commands ... so leaving out "root" from your lines should help.
>
> old: 3,18,33,48 * * * * root run-parts /etc/cron.quarter-hourly
> new: 3,18,33,48 * * * * run-parts /etc/cron.quarter-hourly
Yes and no.
The differentiation here is user crontab vs. system crontab.
User crontabs only permit 6 fields
mim hour day month day-of-week do-this-part
Only the system crontab has a 7th field. The extra field
is at postion 6 and takes as an argument the username of
the user under which do-this-part is to run.
The following are equivalent:
when logged in as user root,
crontab -e
3,18,33,48 * * * * run-parts /etc/cron.quarter-hourly
or edit the file /etc/crontab
3,18,33,48 * * * * root run-parts /etc/cron.quarter-hourly
Andy
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2003-07-30 10:16 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-07-30 7:34 Cronjobs Tom Troonbeeckx
2003-07-30 7:44 ` Cronjobs César Soler
2003-07-30 7:59 ` Cronjobs Vladimír Dvoøák
2003-07-30 8:17 ` Cronjobs Horia Chirculescu
2003-07-30 8:05 ` Cronjobs Stefan Wimmer
2003-07-30 10:16 ` Cronjobs Andrew Kelly
2003-07-30 8:13 ` Cronjobs Scott Taylor
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).