- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: script regarding ssh
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
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
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-19-2011 11:04 PM
12-19-2011 11:04 PM
Re: script regarding ssh
>> echo hello | mailx -s "test mail" rahul_rtns@domain.com
In the mail.log it is giving log as :
Dec 20 00:58:01 houspiqa1 sm-mta[1945]: pBJ9FMjf003896: to=rahul_rtns@domain.com, ctladdr=rtns (116/20), delay=21:42:39, xdelay=00:00:00, mailer=relay, pri=4080152, relay=barbbh1.bwes.net., dsn=4.0.0, stat=Deferred: Connection timed out with barbbh1.bwes.net.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2011 11:19 PM
12-19-2011 11:19 PM
Re: script regarding ssh
>the mail.log it is giving log as:
>stat=Deferred: Connection timed out with barbbh1.bwes.net.
Can you do: nslookup barbbh1.bwes.net
But before we go to far, you need to create another topic in the correct board.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2011 05:45 AM
12-20-2011 05:45 AM
Re: script regarding ssh
Hi Dennis,
The problem is not got ressolved. :)
Thank you very much for the prompt support. It was really wonderfull to learn a lot of things from you. Hope to communicate with you in near future.
Thanks once again..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2011 04:03 AM
12-23-2011 04:03 AM
Re: script regarding ssh
Hi Dennis,
Just one more point:
>>cmp -s serverA_files serverB_files
if [ $? -eq 0 ]; then
In csh the statement if [ $? -eq 0 ]; is not working. May i know how to check the exit status in csh.
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2011 04:39 AM - edited 12-23-2011 05:07 AM
12-23-2011 04:39 AM - edited 12-23-2011 05:07 AM
Re: script regarding ssh
>In csh the statement if [ $? -eq 0 ]; is not working. May I know how to check the exit status in csh.
Don't even think of using the scummy C shell. :-(
mr google says it is something like: if ( $status == 0 ) then
- Tags:
- scummy C shell
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2011 04:58 AM
12-23-2011 04:58 AM
Re: script regarding ssh
But it is giving message as :
if: Empty if.
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2011 05:06 AM - edited 12-23-2011 05:08 AM
12-23-2011 05:06 AM - edited 12-23-2011 05:08 AM
Re: script regarding ssh
>I used if ($status == 0); then
It looks like I was missing some spaces but that ";" shoudn't be there.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-25-2011 10:23 PM
12-25-2011 10:23 PM
Re: script regarding ssh
>>ls /home/rtns/testdir/*.abc | sed -e 's:.*/::g' > serverA_files
ssh root@serverB ls "/home/rtns/a/*.abc" | grep "MPF.*\.abc" | sed -e 's:.*/MPF::g' > serverB_files
cmp -s serverA_files serverB_files
Can i have the statement for matching only the last file of *.abc pattern in both the servers. Actually there are some more files afer *.abc in both the servers. So it is not working. I want to match only the last file of *.abc pattern. That will work for me..
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-26-2011 02:48 AM
12-26-2011 02:48 AM
Re: script regarding ssh
>Can I have the statement for matching only the last file of *.abc pattern in both the servers.
Just pipe it to tail:
ssh root@serverB ls "/home/rtns/a/*.abc" | grep "MPF.*\.abc" | sed -e 's:.*/MPF::g' | tail -1 > serverB_files
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2012 10:10 PM
02-02-2012 10:10 PM
Re: script regarding ssh
Hi,
I am having a little confusion about the feasiblity of the script that i have to prepart to match the files in two servers and if the files matched then trigger the archiving script in server A. The script that i have prepared is :
#!/usr/bin/csh
ls /oracle/MP1/oraarch/*.dbf | sed -e 's:.*/::g' > serverA_files
ssh root@serverB ls "/oracle/MP1/oraarch/*.dbf" | grep "MPFarch.*\.dbf" | sed -e 's:.*/MPFarch::g' > serverB_files
cmp -s serverA_files serverB_files
if ( $status == 0 ) then
/sapbasis/common_scripts/backup_archive.sh
else
comm -3 houeccp1_files austsapdr_files | mailx -s "archiving in prod failed" alias1
endif
rm -f serverA_files serverB_files
I am having confusion that when the files in both the servers has matched the backup_archive.sh script will run. But after comparison of the files in both the servers while the backup_archive.sh is running if a new file is generated in serverA, then that file will also get archived by the backup_archive.sh script, so will miss that newly generated file. So is there any way to reduce this risk.
Will really appreciate your help on this.
Regards,