shell script to upload/ftp files to remote machine automatically

Shell script to upload files using FTP from one machine to remote machine automatically

The below simple shell script will automate the FTP steps, to upload file(s) from one machine to other easily ...
edit it according to ur convinece ..

nc184120:/opt/builds # cat ftp.sh
#!/bin/bash

HOST='9.142.193.94'
USER='root'
PASSWD='havefun'

ftp -i -n $HOST <<kris
user ${USER} ${PASSWD}

binary
cd /opt
put cds_db2_admin.sql
quit
kris

nc184120:/opt/builds # ./ftp.sh
Connected to virgo.in.ibm.com.
220-FTP Server (user 'krishna.g@in.ibm.com')
220
331-Password:
331
230-230 User root logged in.
230
Remote system type is UNIX.
Using binary mode to transfer files.
200 Type set to I.
250 CWD command successful.
local: cds_db2_admin.sql remote: cds_db2_admin.sql
229 Entering Extended Passive Mode (|||64693|)
150 Opening BINARY mode data connection for cds_db2_admin.sql.
100% |**************************************************************************************************************************************|  1101       6.73 MB/s    00:00 ETA
226 Transfer complete.
1101 bytes sent in 00:00 (4.48 KB/s)
221-You have transferred 1101 bytes in 1 files.
221-Total traffic for this session was 1601 bytes in 1 transfers.
221-Thank you for using the FTP service on virgo.
221 Goodbye.




0 comments to "shell script to upload/ftp files to remote machine automatically"

Post a Comment

Whoever writes Inappropriate/Vulgar comments to context, generally want to be anonymous …So I hope U r not the one like that?
For lazy logs, u can at least use Name/URL option which doesn’t even require any sign-in, The good thing is that it can accept your lovely nick name also and the URL is not mandatory too.
Thanks for your patience
~Krishna(I love "Transparency")

Popular Posts

Enter your email address:

Buffs ...

Tags


Powered by WidgetsForFree

Archives