- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- ftp script not working
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
тАО12-17-2006 10:57 PM
тАО12-17-2006 10:57 PM
ftp script not working
I have made d below ftp script but the last part of script ie. moving the files after transfer (to a location in the source server only) is not working for me.
Can anybody pls..help.in same..!!!
#######################################################
#!/bin/sh
ftp -n 10.209.13.11 <
quote PASS xyz
bin
prompt
cd /test
put reports.zip reports.tmp
rename reports.tmp reports.zip
#quit
bye
#END_SCRIPT
#exit 0
echo Arun
mv -f /export/VSNL_RECS_logs/MUM_ILD/strsp/reports.zip /test_script/test/
exit 0
END_SCRIPT
#############################################################
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-17-2006 11:17 PM
тАО12-17-2006 11:17 PM
Re: ftp script not working
does the command work when executed outside the script?
could be a permission problem.
please check
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-17-2006 11:23 PM
тАО12-17-2006 11:23 PM
Re: ftp script not working
For starters, your here-document needs to end where "#END_SCRIPT" appears. In other words, uncomment that line, and remove or comment "END_SCRIPT" appearing at the end of the script.
Next make sure that the ftp user has read permission on reports.zip and write permission on /test_script/test/. Also make sure that reports.zip exists at the time the script is run. Just to be safe, substitute the absolute path to mv (/usr/bin/mv).
Try running the "mv -f ..." command separately. Do you receive any error messages?
PCS
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2006 07:32 PM
тАО12-18-2006 07:32 PM
Re: ftp script not working
if I well understood, try this:
#######################################################
#!/bin/sh
ftp -n 10.209.13.11 <
quote PASS xyz
bin
prompt
cd /test
put reports.zip reports.tmp
rename reports.tmp reports.zip
#quit
bye
END_SCRIPT
#exit 0
echo Arun
mv -f /export/VSNL_RECS_logs/MUM_ILD/strsp/reports.zip /test_script/test/
exit 0
#END_SCRIPT
#############################################################
the END_SCRIPT label has to close teh input for ftp. In this way the mv command will be executed by shell instead of ftp.
HTH,
Art
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2006 07:50 PM
тАО12-18-2006 07:50 PM
Re: ftp script not working
> quote PASS xyz
Why not use a simple "user" command? For
example:
user user_name password
Using "quote USER" and "quote PASS" seems
like the hard way to do the job.
Also, "prompt" affects prompting for
multiple-file commands (like "mget" and
"mput"). You don't seem to be using any of
those.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2006 09:19 PM
тАО12-18-2006 09:19 PM
Re: ftp script not working
Could you use something like this?
It works for me on HPUX 11i:
ftp -in < commands.txt
---File "commands.txt"---
open [machine_ip]
user [ftp_user] [ftp_password]
lcd [full_path_local_dir]
cd [full_path_dest_dir]
bin
mput [files_to_move]
bye
-------------------------
Hope this helps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-18-2006 09:29 PM
тАО12-18-2006 09:29 PM
Re: ftp script not working
#!/bin/sh
ftp -n 10.209.13.11 <
quote PASS xyz
bin
prompt
cd /test
put reports.zip reports.tmp
rename /{fullpath}/reports.zip /{fullpath}/reports.zip
bye
!END_SCRIPT
echo Arun
mv -f /export/VSNL_RECS_logs/MUM_ILD/strsp/reports.zip /test_script/test/
exit 0
This works for me.