- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- sftp automated 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
тАО02-13-2011 12:21 AM
тАО02-13-2011 12:21 AM
sftp automated script
open nashualocal
user FTPUser N@shua!
type ascii
cd Nashua/New_Orders
lcd /usr1/EMBRACE/EMBRACE.LIVE/NASHUA.SALES
mget *.csv
lcd /usr1/EMBRACE/EMBRACE.LIVE/NASHUA.SALES.BACKUP
mget *.csv
cd /Nashua/New_Orders
pwd
!uuencode /usr/bin/nash1.log nash1.log.csv | mailx -m -s "Nashua Confirmation" l
moodley@tarsus.co.za hdebloe@tarsus.co.za ebrown@tarsus.co.za
quit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-13-2011 06:41 AM
тАО02-13-2011 06:41 AM
Re: sftp automated script
Setup public ssh keys between your servers. Then you can do something like:
# cat .mysftp
HOST=$1
FILE=$2
sftp -b - <
cd /tmp
put -P ${FILE} ${FILE}.backup
EOF
RC=$?
print -u2 "\nSFTP returned ${RC}"
exit ${RC}
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-13-2011 09:00 AM
тАО02-13-2011 09:00 AM
Re: sftp automated script
Regards,
Links
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-13-2011 12:06 PM - last edited on тАО08-08-2011 11:43 AM by Kevin_Paul
тАО02-13-2011 12:06 PM - last edited on тАО08-08-2011 11:43 AM by Kevin_Paul
Re: sftp automated script
Hi (again):
You can and should avoid passwords in scripts if you are automating Secure Shell functions like 'scp', 'sftp', etc. Public keys provide the methodology.
Matti Kurkela gives a quick-step view here:
http://h30499.www3.hp.com/t5/System-Administration/sample-script-for-scp-and-sftp/m-p/4243294#M330281
...and Doug O'Leary provides a detailed guide here:
http://www.olearycomputers.com/ll/ssh_guide.html
The 'known_hosts' file contains the public host keys for all known hosts. The per-user version is maintained automatically. Thus, whenever you connect from an unknown host, its key is added to the per-user file if you choose to acknowledge the fingerprint. If you don't, the connection can still be made, but you will be prompted the next time as if you had never connected.
The manpages for 'sshd' and 'ssh' offer more information.
Regards!
...JRF...