FTP Automate Shell Script
ggcameron at gmail.com
Sun Jan 29 19:56:05 PST 2006
A .netrc file (read the ftp man page) may work for you.
On 1/30/06, Angelo Christou <christou44 at yahoo.com> wrote:
> Hello. I am using FreeBSD 6.0 and Bash as my shell. I
> am following a tutorial to create a shell script to
> copy some files. It works perectly exept for 2 points.
> Here is the article -
> Here is the script -
> temp="/tmp/$(basename $0).$$" ; trap "/bin/rm -f
> $temp" 0
> echo "taylor" > $temp
> echo "cd $targetdir" >> $temp
> for file in *
> if [ -f $file ] ; then
> echo "put $file $file" >> $temp
> echo "skipping $file: not a file." >&2
> echo "quit" >> $temp
> ftp $remote < $temp
> exit 0
> One problem is that the password must be entered
> manually, I have spent a good part of the day
> experimenting but can't seem to automate this. Can the
> password be entered using the script?
> The other problem is that it copies the actual file.
> What command would I look at to copy only images
> (.jpg) for example?
> Thanks in advance.
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> freebsd-questions at freebsd.org mailing list
> To unsubscribe, send any mail to "
> freebsd-questions-unsubscribe at freebsd.org"
More information about the freebsd-questions