- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- 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
Discussions
Discussions
Forums
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
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
тАО07-20-2004 05:52 AM
тАО07-20-2004 05:52 AM
ftp script !
I'm testing the next ftp script:
for x in ` cat /sort/LOGS_CRONTAB/logs_home/logs_opers `
do
cd /
cd /sort/LOGS_CRONTAB/logs_home/depot_logs/$x/July04
ftp -i -n 130.10.17.18 <
cd s_inb_01/$x/Julio04
mput *
EOF
done
echo Transfer succesfull | mailx -s "Transfer OK" support@banamex.com
When i execute this shell script, i receive the next message:
# ftp_test
ftp_test: Syntax error at line 5 : `<<' is not matched.
Is very strange because if i write line by line in the command prompt. The script runs good.
Somebody have an idea about this error ?
Thank's in advance !
- Tags:
- ftp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-20-2004 06:05 AM
тАО07-20-2004 06:05 AM
Re: ftp script !
ftp -nv ${SERVER} << FTPEOF > /tmp/temp_log.$$
user ${USERNAME} ${PASSWORD}
#Get file
get $1
quit
FTPEOF
Put this in the do/done loop and it should work.
mput versus get should not make a difference.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Tags:
- here doc
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-20-2004 06:06 AM
тАО07-20-2004 06:06 AM
Re: ftp script !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-20-2004 06:35 AM
тАО07-20-2004 06:35 AM
Re: ftp script !
Shell will prompt if use the <
A good sample script is avaible at http://www.aplawrence.com/SCOFAQ/FAQ_scotec6autoftp.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-20-2004 07:49 AM
тАО07-20-2004 07:49 AM
Re: ftp script !
Dan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-21-2004 04:28 AM
тАО07-21-2004 04:28 AM
Re: ftp script !
I probed yours suggestions, but any works (the sintax error message doesn├В┬┤t disappearing). I use an other form to make the ftp connection, and works fine:
(echo "open 130.10.17.18
user $user $password
cd s_inb_01/$x/July04
mput *
close "
) | ftp -i -n
Best Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-21-2004 06:32 AM
тАО07-21-2004 06:32 AM
Re: ftp script !
The problem is only because of -EOF. Try to use the following script as,
------- ftp.ksh ---------
#!/usr/bin/ksh
set -x
for x in `cat /sort/LOGS_CRONTAB/logs_home/logs_opers`
do
ftp -i -n 130.10.17.18 <<-EOF 2>/dev/null
user cencom1 cencom1
lcd sort/LOGS_CRONTAB/logs_home/depot_logs/$x/July04
cd s_inb_01/$x/Julio04
mput *
bye
EOF
done
[[ $? -eq 0 ]] && echo Transfer succesfull | mailx -s "Transfer OK" support@banamex.com
#normal return
exit 0
-------------------------------
Execute it. It will surely work.