Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Jul 2008 22:03:10 -0400
From:      John Almberg <jalmberg@identry.com>
To:        Bill Moran <wmoran@potentialtech.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: how to simulate a user's crontab?
Message-ID:  <CA5ED776-66DB-4877-883E-EC876ACF85CA@identry.com>
In-Reply-To: <20080716113718.b165f10c.wmoran@potentialtech.com>
References:  <3BC71C1E-DD8B-4FD9-870A-A2D385E556C8@identry.com> <20080716113718.b165f10c.wmoran@potentialtech.com>

next in thread | previous in thread | raw e-mail | index | archive | help
>
> I'm guessing you're having problems with environment settings,  
> although
> the vagaries of the question don't give me much to go on (something
> along the lines of, "when I try to do x in cron, I get the error y;
> but it works fine when the user runs it outside of cron" would be more
> informative.)
>

Well, this got me thinking and I had to do some playing around to  
figure out what was wrong...

The difference was that I was testing the command by su-ing into the  
user, rather than logging in as that user. What I didn't know was su  
does not change your environment, only permissions (as far as I can  
tell)

So I was testing with my environment, but crontab was running under  
the other user's environment.

I always thought that su user and login user were equivalent. Now I  
know better :-)

Anyway, thanks for putting me on the right path.

-- John




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CA5ED776-66DB-4877-883E-EC876ACF85CA>