- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Script for scp to send a file to secondary ser...
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
тАО03-13-2011 10:11 PM
тАО03-13-2011 10:11 PM
Script for scp to send a file to secondary server when a primary server fails
Thanks in Advance..
- Tags:
- scp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2011 03:30 AM
тАО03-14-2011 03:30 AM
Re: Script for scp to send a file to secondary server when a primary server fails
scp ... $(< server-file):
You could also do this automatically if a dummy scp times out, switch to the secondary server.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2011 03:52 AM
тАО03-14-2011 03:52 AM
Re: Script for scp to send a file to secondary server when a primary server fails
In the script i have written the below lines(sample), it worked.
user_dir=local_path
remoteserver=ipaddress1
$ping $remoteserver
if [ $? -eq 0 ]
remote_dir=remotepath1
else
remoteserver=ipaddress2
remote_dir=remotepath2
In the remaining script, the filename is read and moved to the remote directory.
If the secondary server also fails then no one can help. Need to setup both servers if there is any problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2011 04:02 AM
тАО03-14-2011 04:02 AM
Re: Script for scp to send a file to secondary server when a primary server fails
You'll need to add: -n 1 -m 1
Be aware the server can be "down"/hung and still respond to pings. Using scp with a timeout would be a more robust solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2011 04:12 AM
тАО03-14-2011 04:12 AM
Re: Script for scp to send a file to secondary server when a primary server fails
$ping -c 2 $remoteserver
so for a count of 2 pings I am confirming that the server is up, if not then a secondary server is used. Can you please tell me what is the difference between the command you applied and the command i mentioned here.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2011 04:41 AM
тАО03-14-2011 04:41 AM
Re: Script for scp to send a file to secondary server when a primary server fails
> that the server is up [...]
You're confirming that it responds to "ping",
not that it does "scp" correctly. Which is
more important to you? Is the best test of
whether you can transfer a file using "scp"
to run "ping", or to try to transfer a file
using "scp"?
> Using scp with a timeout would be a more
> robust solution.
And/or look at the exit status returned by
"scp".
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-14-2011 04:45 AM
тАО03-14-2011 04:45 AM
Re: Script for scp to send a file to secondary server when a primary server fails
I see no -c option to HP-UX ping(1m) on 11.31.
-n is the count and -m is the timeout in seconds.