Koozali.org: home of the SME Server

Legacy Forums => Experienced User Forum => Topic started by: Sam on May 05, 2003, 03:31:56 AM

Title: automated ftp script
Post by: Sam on May 05, 2003, 03:31:56 AM
Hi

Im trying to create a automated ftp script.

I have a few problems when i try and run it.

its run from a sep script which runs the command

ftp -i -n domain.com < output.txt


output.txt consists of

user username passwd
ascii
put filename
close
bye

When i run this i get the following error
: No such file or directory

I have tried running this by

typing ftp -i -n domain.com
and then just pasting output.txt into the window and it all runs fine and uploads the file. the only way it works automated is if i remove the put filename command which kinda renders it useles. this has me completely stumped as i cant see any obvious error.

Any help would be much appreciated.

Thanks
Sam
Title: Re: automated ftp script
Post by: Michiel on May 05, 2003, 02:59:17 PM
I'm not sure what is causing your problem, but if you want to ftp from a script, you better use ncftpput. It's already installed on your machine and specifically written for this purpose. Try man ncftpput.

Regards,
Michiel
Title: Re: automated ftp script
Post by: Sam on May 05, 2003, 05:30:16 PM
bash: ncftpput: command not found

it doesnt seem to be installed by default. Is it worth installing it?! and would u know of whr i could find the rpm for it?!

thanks
Sam
Title: Re: automated ftp script
Post by: Michiel on May 05, 2003, 09:04:26 PM
Oups, sorry. It's one of these tools I install automatically on an SME box, so I assumed everybody has it :-)

Is it worth installing? From the man pages:
       The purpose of ncftpput is to do file transfers  from  the
       command-line  without entering an interactive shell.  This
       lets you write shell scripts or other unattended processes
       that can do FTP.

So I gues it does what you're looking for.

You can download the ncftp tools from http://ftp.redhat.com/pub/redhat/linux/9/en/os/i386/RedHat/RPMS/ncftp-3.1.5-4.i386.rpm

Regards,
Michiel
Title: Re: automated ftp script
Post by: Byte on May 06, 2003, 12:45:31 AM
Hi,

What about the mirror command search on freshmeat. Type mirror in search system and see if thats what you need.

Hope this helps

Byte
Title: Re: automated ftp script
Post by: Marco on May 07, 2003, 01:21:43 PM
http://www.star-support.com/downloads/mitel/contrib/weex/
IMHO much easier to setup than mirror.

Example config:

[dnet]
HostName        = wwww.elsewhere.com
LoginName       = user
Password        = secret
SrcDir          = /home/e-smith/files/ibays/web/html/dnet
DestDir         = /
IgnoreRemoteDir = /test

Run thru "weex -m dnet"
Title: Re: automated ftp script
Post by: fozyberto on May 07, 2003, 08:02:37 PM
try using ftpfs..u can mount an ftp as a directory....and is easier ..cuz u handle the remote ftp as a local directoryMarco wrote:
>
> http://www.star-support.com/downloads/mitel/contrib/weex/
> IMHO much easier to setup than mirror.
>
> Example config:
>
> [dnet]
> HostName        = wwww.elsewhere.com
> LoginName       = user
> Password        = secret
> SrcDir          = /home/e-smith/files/ibays/web/html/dnet
> DestDir         = /
> IgnoreRemoteDir = /test
>
> Run thru "weex -m dnet"
Title: Re: automated ftp script
Post by: Michiel on May 07, 2003, 08:59:34 PM
Neat. Where do I find ftpfs? Would it for example allow me to mount ftp.redhat.com/pub as a local folder and than map it to a drive on a Windows client (using samba/netlogon.bat).

Michiel