- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- SFTP script assistance
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
10-11-2005 09:22 AM
10-11-2005 09:22 AM
SFTP script assistance
I'm attempting to automate a process that checks for the existence of files in a top level directory with 4 subdirectories, if it exists, it launches sftp to transfer the file to some location, it validates the send, then deletes the file. The structure would be something like this:
/scproot/dir_out
/scproot/dir_out/dir1
/scproot/dir_out/dir2
/scproot/dir_out/dir3
/scproot/dir_out/dir4
Each subdirectory may contain *.xml file.
I know this is not secure but it is for testing only at this time:
the sftp portion would be something like
#!/usr/bin/sh
HOST='myhost.com'
USER='username'
PASSWD='password'
sftp $USER@$HOST <
binary
cd /dir1/dir2/
put some_file
Can someone help me script this appropriately?
Thanks,
Dave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2005 09:34 AM
10-11-2005 09:34 AM
Re: SFTP script assistance
If you configure the keys you do not need to worry about having the $USER and $PASSWD hardcoded in the script.
Another option could be to use scp. If the file exists then secure copy the file. If the file does not exist, then the logic in the script will indicate this. After all tranfers are completed, you could use ssh to issue the rm command
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2005 09:58 AM
10-11-2005 09:58 AM
Re: SFTP script assistance
Thanks for the information. In this particular case, I will need ot use sftp. I'm actually hoping to make it scp shortly but I can't at this time. The RSA keys will follow in time as well, making the username/passwd unneccesary as you stated. I'm still going to need to create a script to do the search of the directories for *.xml and then do an sftp. Perhaps the sftp could be in a separate script.
Dave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2005 05:40 AM
10-12-2005 05:40 AM
Re: SFTP script assistance
I know I can't pass the password in a configuration file even in batch mode so I'll have to go to RSA key exchnage. However, I would still appreciate some assistance on finding the *.xml files and creating an sftp script that can pass the RSA keys. I would like to use scp but at least for now, I must use sftp.
Thanks for the input.
Dave
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-13-2005 05:12 AM
10-13-2005 05:12 AM