strange behavior in my cron job

strange behavior in my cron job

Post by Frank Chen » Fri, 20 Oct 2000 09:11:11



I just met a strange problem in cron job. I use PIII650,128MB RAM, Redhat6.2
installed.

I have an entry in cron job: 30 7 * * 1-5 /etc/ppp/ppp-on; this will connect
to my isp every morning. But it failed. Looking at the log file, I only get
the message saying "script failed". Actually, when I manually run the script
at command line as root "# /etc/ppp/ppp-on" and it works. And I notice that
in the log it also state that script started.

Is there any difference when I run in command line and put it in the cron
job? I have another entry "0 17 * * 1-5 /etc/ppp/ppp-off" in cron job and it
works both in command line and cron job.

I appreciate any suggestion.

Frank

 
 
 

strange behavior in my cron job

Post by Jean-David Beye » Sun, 31 Dec 1899 09:00:00



> I just met a strange problem in cron job. I use PIII650,128MB RAM, Redhat6.2
> installed.

> I have an entry in cron job: 30 7 * * 1-5 /etc/ppp/ppp-on; this will connect
> to my isp every morning. But it failed. Looking at the log file, I only get
> the message saying "script failed". Actually, when I manually run the script
> at command line as root "# /etc/ppp/ppp-on" and it works. And I notice that
> in the log it also state that script started.

> Is there any difference when I run in command line and put it in the cron
> job? I have another entry "0 17 * * 1-5 /etc/ppp/ppp-off" in cron job and it
> works both in command line and cron job.

> I appreciate any suggestion.

> Frank

It may depend on where you have this cron job. If it is in /etc/crontab, it
will run with root authority and (I believe) root's environment (unless you do
something to change it). If you set it up in /var/spool/cron using crontab -e,
it should run with your permissions and the environment you had when running
crontab -e (IIRC).

--
 .~.   Jean-David Beyer           Registered Linux User 85642.
 /V\                              Registered Machine    73926.
/( )\  Shrewsbury, New Jersey
^^-^^  7:45am up 9 days, 13:23, 3 users, load average: 3.06, 3.09, 3.05

 
 
 

1. CRON+rcp -> Strange Behaviour

Hey folks,

        I am really having a lot of trouble these days. If someone has an idea
about this, let me know please!

In short:

I am having a program being run UID root by cron at 2:00 at night. This
program uses rcp to transfer things to another host. On the remote host
I put .rhost file to roots homedir, which just includes one line with
the name of the system the rcp is executed on. The hostname is
resolveable.

Whenever I run that program manually, it works all fine. If I am running
it from cron at night the rcp gets a "Permission Denied" (yes, the UID
is the same at night...really ;D). Ok, I just changed the execution time
in cron to 3 o clock in the afternoon, and ... it is working perfectly
fine again.

Does anyone have an idea what this can be?

Is it possible that for some reason the rcp works, while I am logged in
at the system (, which is not the case at 2:00 at night)?

Does the .rhosts file have to contain a username for the system, too?
(Like: systemname root) ?

Any thoughts about that are greatly appreciated!

It would be very kind, if you could mail me a copy of your reply to

Thanks in advance,

Dennis Wetzig

2. Teac CD55a

3. CRON - Strange behavior

4. Looking for ISP server

5. Strange behaviour of cron

6. Program to configure fvwm95

7. Difference between cron job and real time job

8. Cold Fusion Install Problem

9. Jobs, Jobs, Jobs And More Jobs!!!