- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: automatic FTP script
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2008 03:20 AM
02-06-2008 03:20 AM
I am doing FTP with a shell script but it is not running properly.Please send me if anybody have any automatic ftp script.
#!/usr/sbin/sh
ftp -i -n 10.1.1.76
user (username)/(password)
bin
cd /home/user home dir
lcd /home/dir
mget *.txt
bye
regards,
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2008 04:52 AM
02-06-2008 04:52 AM
Solution#!/usr/sbin/sh
USER=bill
PW=abc123
ftp -v -i -n 10.1.1.76 << EOF
user $USER $PW
bin
cd /home/$USER
lcd /home/$USER
mget *.txt
bye
EOF
The << EOF string says: take the following lines and feed them into ftp, then stop when EOF is found.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2008 05:08 AM
02-06-2008 05:08 AM
Re: automatic FTP script
This will not work. One way using this technique is:
{ echo "open 10.1.1.76
user theuser thepassword
type binary
cd /home/userhomedir
lcd /home/dir
mget *.txt
bye"
} | ftp -in
A more secure way than putting an account password into a script (although still not the most secure way) is to use the '.netrc' file. See the manpages for 'netrc(4)'.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2008 07:42 AM
02-06-2008 07:42 AM
Re: automatic FTP script
wget "ftp://${user}:${pass}@10.1.1.76/home/user_home_dir/*.txt"
http://www.gnu.org/software/wget/wget.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2008 10:50 PM
02-06-2008 10:50 PM
Re: automatic FTP script
I have tried your script it's working nice.
Keep up the good work.
Thank you very much
regards,
Sumit