- 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
Forums
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
08-29-2000 02:53 PM
08-29-2000 02:53 PM
I have the following script to send a specific file to a specific IP. I would like to put my script file in one place and actual file to transfer is another directory. But when I tried to put in the full path of sourcefile I got an error. Can anyone help? How would I tell ftp to look in the other directory and put the file? The script runs fine when the script file and sourcefile are in the same directory. Also, I will run this fron cron, do I have to change the script to accomodate for cron?
# machine=$1
# sourcefile=$2
# destfile=$3
ftp -n -i <<-EOF
open xxx.xxx.xxx.xxx
user username passwd
binary
mput pic.jpg
quit
Thanks for your help,
Sanjay.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2000 03:18 PM
08-29-2000 03:18 PM
Re: FTP Script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2000 03:20 PM
08-29-2000 03:20 PM
Re: FTP Script
1. After the line for user / password, do:
$ACTION $LOCALFILE $REMOTEFILE
where ACTION is "put" or "get" and LOCALFILE is the name of the file on the host that this script is running; and REMOTEFILE is the name of the file on the server to which you are putting or getting.
2. I would use absolute paths for the LOCALFILE and REMOTEFILE. This will allow you to cd to the directory in which your script resides, pass the arguments you want for LOCALFILE & REMOTEFILE, and execute.
3. The script as you have shown should work fine under cron.
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2000 03:28 PM
08-29-2000 03:28 PM
Re: FTP Script
Thank you for your suggestions. While offline, I looked at the FTP man page (again) and found a command called lcd which lets me change the local directory to whatever I want. I tried it and it seems to be working. I put it into the script right after I supply the username and passwd.
Sanjay.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-29-2000 03:33 PM
08-29-2000 03:33 PM
Re: FTP Script
Your most welcome!!! Points are always appreciated too.
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2000 07:44 PM
08-31-2000 07:44 PM
Solution# ftp -v -n < ftp.script
(Inside of ftp.script file)
open
user xxx yyy
prompt off
cd
lcd
binary
mget filename
bye