Mailing List Archive


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

[tlug] cron and lftp problems



Today I  wrote 2 scripts
1 is a lftp  script to log into a remote server get updated data
2 is a run script that runs the program and then writes the events to a log
file

Independently they both work, the lftp script can log in and dl files from
the remote server, the run script can run the lftp script and writes the
findings to the log file. The problem occurs when I try to cron the job. The
script returns a error saying it cant find the lftp command. 
I am completely baffled by this cause I use this same script in several
other places and in the same fashion and it always works like a dream. 

First Ver info 
Server Red Hat 7.2 
Lftp Version 2.6.5 
<code>
Run script

#!/bin/sh
# source environment
. /etc/profile
# set logfile
logfile="/home/httpd/xyzsite/xyzcom.log"
#get the current date and time and put append it to the log file
date >> "$logfile"
# run script, log all output to file.
/home/httpd/xyzsite/upload >> "$logfile" 2>&1

lftpscript *note this can not have any carriage returns or it will not work
lftp -e 'set ssl:verify-certificate no && open ftp://user:pass@example.com
&& cd /localdir/html && lcd /remote/dir /on/remote/server && mirror -cn
dir_to_copy && exit EOF'
</code>

Log file entries
Wed Jan 26 17:34:22 JST 2005<--------- When I run from command line 
cd ok, cwd=/to_t-mark
lcd ok, local cwd=/home/httpd/some dir
Usage: exit [<exit_code>]
Total: 3 directories, 4 files, 0 symlinks
To be removed: 1 directory, 0 files, 0 symlinks
Wed Jan 26 17:35:00 JST 2005<-----------When the cron job runs
/home/httpd/sfcg/sfcg-ircom/upload: lftp: command not found

Any thoughts on this would be appreciated. Thanks 
Erin

<<attachment: winmail.dat>>


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links