Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
16 years ago

Automate FTP

Hello champs,

I am trying to write a routine that automates FTP transfers. I was using ftpput in Busybox but it consumes way too much memory. I've seen some examples but they are in ksh and Perl? I am sort of a newbie in linux, I know how some things work but have still got a lot to learn.

I paste the example I found from a linux forum.

Example from here (http://www.unix.com/answers-frequently-asked-questions/14020-automate-ftp-scripting-ftp-transfers.html):

#! /usr/bin/ksh

host=remote.host.name

user=whoever

passwd=whatever

exec 4>&1

ftp -nv >&4 2>&4 |&

print -p open $host

print -p user $user $passwd

print -p cd directory

print -p binary

print -p put tar.gz

print -p bye

wait

exit 0

However, I don't know if there is a 'print' command in msh or sash

I think this would be a lighter option over SSH.

Any ideas will be appreciated.

Thanks in advance.

14 Replies