Need Assistant to create shell script

27 views
Skip to first unread message

Bharat Raj

unread,
Apr 25, 2015, 1:00:39 AM4/25/15
to vglug
Hi Geeks,

i want to create a shell script for AWS DB Read Replica. can somebody help me on this. the scenario is as below:

i have 3  commands which  i want to run through shell script as rds-create-db-instance-read-replica scripttest -s dbinstance, rds-describe-db-instances scripttest and rds-promote-read-replica scripttest.

rds-create-db-instance-read-replica scripttest ==> this command is working fine but it takes time 15, 20 minutes or sometimes hours. after completion of this i want to run rds-promote-read-replica scripttest. rds-describe-db-instances scripttest is to get the status of current stat of instance so i ran rds-describe-db-instances scripttest and redirect its output to a file with grep which has string "pending-apply" now i want to set condition for this string pending-apply if  true then execute next command rds-promote-read-replica scripttest if pending-apply not match then dont execute this.



Thanks
Bharat









ElectroMech

unread,
Apr 29, 2015, 3:13:56 AM4/29/15
to vglug
Hi,
You can add "and" condition or if loop.

Or create two different script and add to cronjob. One is for
rds-create-db-instance-read-replica scripttest. and then second to get
the pending-apply status and based on action.

Or please upload the script what ever you have will try to help.


>
>
> Thanks
> Bharat
>
>
>
>
>
>
>
>
>
> --
> Please read http://www.catb.org/~esr/faqs/smart-questions.html before
> posting.
> You received this message because you are subscribed to the "Vibrant
> GNU/Linux User Group".
> To stop receiving emails from this group, mail to
> VGLUG+un...@googlegroups.com
> To post to this group, send email to VG...@googlegroups.com
> For more options, visit this group at http://groups.google.com/group/VGLUG
>
> ---
> You received this message because you are subscribed to the Google Groups
> "VGLUG" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to vglug+un...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



--
--
Nilesh Vaghela
(RHCSA RHCE)
ElectroMech Corporation
Redhat Channel Partner and Training Partner
302, New York Plaza, Opp Judges Bunglow, Bodakdev, Ahmedabad
22, 1st Floor, Vardhaman Complex, Subhanpura , Baroda.
www.electromech.info
Reply all
Reply to author
Forward
0 new messages