- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: help in ftp
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
08-15-2002 12:08 AM
08-15-2002 12:08 AM
help in ftp
How can I enter a user and password in a script that is run by crontab ?
thanks.
Amir
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2002 12:22 AM
08-15-2002 12:22 AM
Re: help in ftp
ftp hostname <
put file1 file2
bye
EOF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2002 12:23 AM
08-15-2002 12:23 AM
Re: help in ftp
try it:
#!/usr/bin/sh
# Script to FTP file
# ftp host user password source_file destination_dir
set -x
HOST=$1
USER=$2
PASS=$3
FILE=$4
DEST_DIR=$5
( echo "user $USER $PASS"
echo "binary"
echo "cd $DEST_DIR"
echo "put $FILE"
echo "quit" ) | ftp -i -n $HOST
use:
./script server1 jack pass file dir1
hope it help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2002 12:24 AM
08-15-2002 12:24 AM
Re: help in ftp
We have the following in a script for ftp
{ ftp -n -v $FTPSERVER << ENDOFGET
user $FTPUSER $FTPPASSWD
prompt
binary
get $GETFILE $LOCALFILE.transfer
close
ENDOFGET
} > $TMPFILE 2>&1
$FTPSERVER is the remote server
$FTPUSER is the username
$FTPPASSWD is the password for that user
Hope this helps
Regards,
Hilary
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-15-2002 12:34 AM
08-15-2002 12:34 AM
Re: help in ftp
Create this in their home directory.
It can contain a number of entries in the format
machine
set this file to have read only permissions for the user
chmod 400 .netrc
then, ftp to the machine identified by
This should then automatically log you in to the server without requesting an ID/password.
Don't forget that having passwords in scripts and .netrc files can be a security risk.