- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Script question - how to automate an sftp process
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
12-13-2007 07:40 AM
12-13-2007 07:40 AM
I need to script a process to transfer a directory of files created daily to a remote server. The directory will be named by the date created - for example yesterday's is 20071212.
I need to transfer the directory and all its files.. I sure appreciate any suggestions! Thanks so much ..
John Henrikson
Univ. of Missouri
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2007 07:46 AM
12-13-2007 07:46 AM
Re: Script question - how to automate an sftp process
Perl enables you to perform FTP and SFTP and makes the error handling simple.
The Net::FTP module comes with the core Perl distribution and Net::SFTP is available from CPAN for installation.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2007 07:47 AM
12-13-2007 07:47 AM
Re: Script question - how to automate an sftp process
Why not script rsync to do this for you via ssh? As long as root keys are in place, you could rsync the directory over to the destination via cron daily. It also avoids hard-coding passwords in a script.
Regards,
Eric
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2007 07:47 AM
12-13-2007 07:47 AM
Re: Script question - how to automate an sftp process
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2007 07:55 AM
12-13-2007 07:55 AM
Re: Script question - how to automate an sftp process
thanks again..
JH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2007 08:32 AM
12-13-2007 08:32 AM
SolutionSomething like
#!/usr/bin/sh
DAYPRIOR=$(/usr/local/bin/caljd.sh -y -s $(/usr/local/bin/caljd.sh -p 1 ))
ssh mkdir remotehost mkdir /filesystem/${DAYPRIOR}
scp -pr /filesystem/directory remotehost:/filesystem/$DAYPRIOR}
Very basic example. No error checking at all. But you should get an idea of what I'm getting at.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-13-2007 08:58 AM
12-13-2007 08:58 AM