bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What is the correct way to set up login environment in crontab?


From: Greg Wooledge
Subject: Re: What is the correct way to set up login environment in crontab?
Date: Wed, 9 Nov 2011 08:45:12 -0500
User-agent: Mutt/1.4.2.3i

On Tue, Nov 08, 2011 at 09:46:37PM -0600, Peng Yu wrote:
> I need to use cron to run some job. I know that cron only set up very
> basic environment. I'd like to duplicate my login environment.

Just source /etc/profile and your ~/.bash_profile or ~/.profile (or
whatever) from the script that your cron job executes.

Personally I would advise against this.  Login environments are for
interactive logins, not cron jobs.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]