From mboxrd@z Thu Jan 1 00:00:00 1970 From: Luca Ferrari Subject: Re: cron script won't run Date: Tue, 26 Sep 2006 11:05:55 +0200 Message-ID: <200609261105.55095.fluca1978@infinito.it> References: <4518E510.2060201@connectinternetsolutions.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <4518E510.2060201@connectinternetsolutions.com> Content-Disposition: inline Sender: linux-admin-owner@vger.kernel.org List-Id: Content-Type: text/plain; charset="us-ascii" To: linux-admin@vger.kernel.org On Tuesday 26 September 2006 10:30 Adam T. Bowen's cat, walking on the keyboard, wrote: > Hi, > > Matthew Metzger wrote: > > I have a script that works great when I run it from the command line, > > but doesn't work at all when added to crontab. > > # cat /dev/sysadm/mantra > The environment from within cron is not necessarily the same as that of > an interactive shell. It is possible to specify environment variables in the crontab file, thus to create an environment similar to the one the user work in interactive mode: [t35@server 35]$ crontab -l PATH=/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/usr/games:/opt/gnome/bin:/opt BASH_ENV=$HOME/.bashrc LPDEST=stt35 MAIL=/var/mail/t35 USERNAME="" DFENV=/home/t35/dfenv.cfg TERMINFO=/usr/share/terminfo DFTERMINFO=/vol1/df31d/lib/terminfo LINES=25 COLS=80 USER=t35 DFUSER=35 10 21 * * 1-6 /your/crontab/job Also making into your script a redirection to a log file could help finding out what is the problem. Luca