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.