Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] cron and lftp problems
- Date: Wed, 26 Jan 2005 07:32:33 -0500
- From: Josh Glover <jmglov@example.com>
- Subject: Re: [tlug] cron and lftp problems
- References: <IDEBIMGDAKLIOLIMNIKGEEAACFAA.erin@example.com> <20050126093025.61039.qmail@example.com>
On Wed, 26 Jan 2005 01:30:25 -0800 (PST), Jake Morrison <jake_morrison@example.com> wrote: > The PATH for cron scripts is different from that of your interactive shell. > > Generally speaking, from a security standpoint, it is not a good idea to > rely on the PATH for administrative scripts. > > You should just hard code the path to the lftp command in the script, > e.g. /usr/bin/lftp -e ...... I put a bunch of "constants" at the top of my scripts: AWK=/bin/awk CAT=/bin/cat GREP=/bin/grep SCP=/usr/bin/scp SED=/bin/sed SSH=/usr/bin/ssh And then, my commands look like this: servers=`${CAT} ${file} | ${SED} -e 's/\t/ /g' | ${AWK} '{ print $1 }'` for i in ${servers}; do ${SSH} $i ${GREP} foo ${foofile} if [ $? -ne 0 ]; then ${SCP} ${foofile} $i:${foofile} fi done -Josh
- Follow-Ups:
- Re: [tlug] cron and lftp problems
- From: Jake Morrison
- References:
- [tlug] cron and lftp problems
- From: Erin D. Hughes
- Re: [tlug] cron and lftp problems
- From: Jake Morrison
Home | Main Index | Thread Index
- Prev by Date: RE: [tlug] cron and lftp problems
- Next by Date: Re: [tlug] cron and lftp problems
- Previous by thread: RE: [tlug] cron and lftp problems
- Next by thread: Re: [tlug] cron and lftp problems
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links