Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

script for put a file into a FTP Server with Solaris 8

258 views
Skip to first unread message

Javier Villegas

unread,
Aug 25, 2003, 10:19:09 AM8/25/03
to
Hi

I need to make a script for schedule a job that every day put a file into a
FTP Server. I am using Solaris 8

I need to autenticate, change to bin mode and finnally put the file LOG.tar

Thanks in advance

Ludovic BOILE

unread,
Aug 25, 2003, 10:53:11 AM8/25/03
to
Try this :

ftp -i -v -n hostame_ftp_server <<EOF
user login passwd
binary
put filename
bye
EOF

for more information, man ftp ! ;-)

Ludovic


Javier Villegas <ma...@impsat1.com.ar> a écrit dans le message :
cPo2b.2051$mm3...@fe06.atl2.webusenet.com...

Dave

unread,
Sep 1, 2003, 6:57:27 PM9/1/03
to
"Javier Villegas" <ma...@impsat1.com.ar> wrote in message news:<cPo2b.2051$mm3...@fe06.atl2.webusenet.com>...


Check out Expect:

http://expect.nist.gov/


--Dave

Barton Fisk

unread,
Sep 1, 2003, 10:33:49 PM9/1/03
to
On 1 Sep 2003 15:57:27 -0700, Dave <d_sm...@hotmail.com> wrote:

> "Javier Villegas" <ma...@impsat1.com.ar> wrote in message
> news:<cPo2b.2051$mm3...@fe06.atl2.webusenet.com>...
>> Hi
>>
>> I need to make a script for schedule a job that every day put a file
>> into a
>> FTP Server. I am using Solaris 8
>>
>> I need to autenticate, change to bin mode and finnally put the file
>> LOG.tar


Save and make executable as putlog.ksh:

usage: putlog.ksh username userpass destination

#!/bin/ksh
USERID="user "$1" "$2
ftp -n <<+++
open $3
$USERID
bin
put LOG.tar LOG.tar
bye
+++

It's not too pretty but it works.

Barton Fisk

--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/

Bret Sanders

unread,
Sep 23, 2003, 1:46:06 PM9/23/03
to
Sometimes it's easier to use ncftp for this. Then you can get it done
with a one-liner. ncftp is available from sunfreeware.com.

ncftpput -u username -p passwd remotehost remote-dir LOG.tar

Default transfer type is binary - no need to specify it in your case.

Bret


"Javier Villegas" <ma...@impsat1.com.ar> wrote in message news:<cPo2b.2051$mm3...@fe06.atl2.webusenet.com>...

Eunice Santorini

unread,
Sep 24, 2003, 4:09:50 AM9/24/03
to
1. Create this working tested $HOME/.netrc file
machine ftp.tin.org login anonymous password your...@yourDomain.com
macdef init
lcd /tmp
binary
prompt
cd pub/news/clients/tin/stable/
get tin-current.tar.gz
quit
<blank line>
<blank line>

2. Then crontab a command of:
%ftp ftp.tin.org

3. The steps in your ~/.netrc will run automatically, in series,
causing the FTP download (or upload) to occur automatically.

Eunice Santorini

unread,
Sep 24, 2003, 4:19:58 AM9/24/03
to
1. Read the Anonymous FTP FAQ:
http://www.faqs.org/faqs/ftp-list/faq/
http://hoohoo.ncsa.uiuc.edu/ftp/faq.html

2. Specifically view the section titled:
(13) How do I automate ftp sessions?

3. See also XTP (The Xpress Transport Protocol)
http://www.ca.sandia.gov/xtp/xtp.html

Eunice

Frank da Cruz

unread,
Sep 24, 2003, 9:36:53 AM9/24/03
to
In article <558bba75.03092...@posting.google.com>,
Eunice Santorini <unixa...@yahoo.com> wrote:
: 1. Read the Anonymous FTP FAQ:

: http://www.faqs.org/faqs/ftp-list/faq/
: http://hoohoo.ncsa.uiuc.edu/ftp/faq.html
:
: 2. Specifically view the section titled:
: (13) How do I automate ftp sessions?
:
These date from 1997 and 1995, respectively. For more recent developments,
also see:

http://www.columbia.edu/kermit/ftpscripts.html

- Frank

0 new messages