<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Script for scp to send a file to secondary server when a primary server fails in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-scp-to-send-a-file-to-secondary-server-when-a-primary/m-p/4764742#M657345</link>
    <description>&amp;gt;what is the difference between the command you applied and the command I mentioned here.&lt;BR /&gt;&lt;BR /&gt;I see no -c option to HP-UX ping(1m) on 11.31.&lt;BR /&gt;-n is the count and -m is the timeout in seconds.</description>
    <pubDate>Mon, 14 Mar 2011 11:45:14 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2011-03-14T11:45:14Z</dc:date>
    <item>
      <title>Script for scp to send a file to secondary server when a primary server fails</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-scp-to-send-a-file-to-secondary-server-when-a-primary/m-p/4764736#M657339</link>
      <description>I have two servers where one is primary and one is secondary. I Will generally move my files to primary server with secondary server as backup. If suddenly my primary server fails or is down, then the secondary server will be in use. I need to write the script for this. As I am new on unix machine couldnt find a solution. Please let me know if any further information required.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks in Advance..&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 14 Mar 2011 05:11:54 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-scp-to-send-a-file-to-secondary-server-when-a-primary/m-p/4764736#M657339</guid>
      <dc:creator>SubhadraRaju</dc:creator>
      <dc:date>2011-03-14T05:11:54Z</dc:date>
    </item>
    <item>
      <title>Re: Script for scp to send a file to secondary server when a primary server fails</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-scp-to-send-a-file-to-secondary-server-when-a-primary/m-p/4764737#M657340</link>
      <description>I assume this should be a simple matter of changing the server name in your scp command.  You can put the name it a file and change it manually:&lt;BR /&gt;scp ... $(&amp;lt; server-file):&lt;BR /&gt;&lt;BR /&gt;You could also do this automatically if a dummy scp times out, switch to the secondary server.</description>
      <pubDate>Mon, 14 Mar 2011 10:30:06 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-scp-to-send-a-file-to-secondary-server-when-a-primary/m-p/4764737#M657340</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-03-14T10:30:06Z</dc:date>
    </item>
    <item>
      <title>Re: Script for scp to send a file to secondary server when a primary server fails</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-scp-to-send-a-file-to-secondary-server-when-a-primary/m-p/4764738#M657341</link>
      <description>Thanks for the info Dennis. But found the solution myself. &lt;BR /&gt;&lt;BR /&gt;In the script i have written the below lines(sample), it worked.&lt;BR /&gt;&lt;BR /&gt;user_dir=local_path&lt;BR /&gt;remoteserver=ipaddress1&lt;BR /&gt;$ping $remoteserver&lt;BR /&gt;if [ $? -eq 0 ]&lt;BR /&gt;   remote_dir=remotepath1&lt;BR /&gt;else&lt;BR /&gt;   remoteserver=ipaddress2&lt;BR /&gt;   remote_dir=remotepath2&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;In the remaining script, the filename is read and moved to the remote directory.&lt;BR /&gt;&lt;BR /&gt;If the secondary server also fails then no one can help. Need to setup both servers if there is any problem.</description>
      <pubDate>Mon, 14 Mar 2011 10:52:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-scp-to-send-a-file-to-secondary-server-when-a-primary/m-p/4764738#M657341</guid>
      <dc:creator>SubhadraRaju</dc:creator>
      <dc:date>2011-03-14T10:52:32Z</dc:date>
    </item>
    <item>
      <title>Re: Script for scp to send a file to secondary server when a primary server fails</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-scp-to-send-a-file-to-secondary-server-when-a-primary/m-p/4764739#M657342</link>
      <description>&amp;gt; $ping $remoteserver&lt;BR /&gt;&lt;BR /&gt;You'll need to add: -n 1 -m 1&lt;BR /&gt;Be aware the server can be "down"/hung and still respond to pings.  Using scp with a timeout would be a more robust solution.</description>
      <pubDate>Mon, 14 Mar 2011 11:02:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-scp-to-send-a-file-to-secondary-server-when-a-primary/m-p/4764739#M657342</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-03-14T11:02:42Z</dc:date>
    </item>
    <item>
      <title>Re: Script for scp to send a file to secondary server when a primary server fails</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-scp-to-send-a-file-to-secondary-server-when-a-primary/m-p/4764740#M657343</link>
      <description>Yes Dennis, I forgot to mention earlier. I have given it like &lt;BR /&gt;&lt;BR /&gt;$ping -c 2 $remoteserver&lt;BR /&gt;&lt;BR /&gt;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.</description>
      <pubDate>Mon, 14 Mar 2011 11:12:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-scp-to-send-a-file-to-secondary-server-when-a-primary/m-p/4764740#M657343</guid>
      <dc:creator>SubhadraRaju</dc:creator>
      <dc:date>2011-03-14T11:12:02Z</dc:date>
    </item>
    <item>
      <title>Re: Script for scp to send a file to secondary server when a primary server fails</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-scp-to-send-a-file-to-secondary-server-when-a-primary/m-p/4764741#M657344</link>
      <description>&lt;!--!*#--&gt;&amp;gt; so for a count of 2 pings I am confirming&lt;BR /&gt;&amp;gt; that the server is up [...]&lt;BR /&gt;&lt;BR /&gt;You're confirming that it responds to "ping",&lt;BR /&gt;not that it does "scp" correctly.  Which is&lt;BR /&gt;more important to you?  Is the best test of&lt;BR /&gt;whether you can transfer a file using "scp"&lt;BR /&gt;to run "ping", or to try to transfer a file&lt;BR /&gt;using "scp"?&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Using scp with a timeout would be a more&lt;BR /&gt;&amp;gt; robust solution.&lt;BR /&gt;&lt;BR /&gt;And/or look at the exit status returned by&lt;BR /&gt;"scp".</description>
      <pubDate>Mon, 14 Mar 2011 11:41:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-scp-to-send-a-file-to-secondary-server-when-a-primary/m-p/4764741#M657344</guid>
      <dc:creator>Steven Schweda</dc:creator>
      <dc:date>2011-03-14T11:41:53Z</dc:date>
    </item>
    <item>
      <title>Re: Script for scp to send a file to secondary server when a primary server fails</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/script-for-scp-to-send-a-file-to-secondary-server-when-a-primary/m-p/4764742#M657345</link>
      <description>&amp;gt;what is the difference between the command you applied and the command I mentioned here.&lt;BR /&gt;&lt;BR /&gt;I see no -c option to HP-UX ping(1m) on 11.31.&lt;BR /&gt;-n is the count and -m is the timeout in seconds.</description>
      <pubDate>Mon, 14 Mar 2011 11:45:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/script-for-scp-to-send-a-file-to-secondary-server-when-a-primary/m-p/4764742#M657345</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-03-14T11:45:14Z</dc:date>
    </item>
  </channel>
</rss>

