All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tomasz Chmielewski <mangoo@wpkg.org>
To: LVM general discussion and development <linux-lvm@redhat.com>
Subject: Re: [linux-lvm] Simple scripts for use in automated backups?
Date: Wed, 23 Apr 2008 15:35:11 +0200	[thread overview]
Message-ID: <480F3B0F.6010205@wpkg.org> (raw)
In-Reply-To: <480F3680.6030900@Media-Brokers.com>

Charles Marcus schrieb:
> Hello again,
> 
> Sorry to flood the list with newbie questions... if there is a better 
> list for things like this, please let me know...
> 
> I'm still fairly new to linux (coming from windows world), and enjoying 
> the freedom, but as far as scripting goes - well, to call me a noob is 
> being kind...
> 
> Would any kind souls be willing to share some basic scripts that can be 
> used to activate a snapshot, then 'do x' (this would be my rsnapshot 
> command), then release the snapshot? The part that I don't have a clue 
> about is how to check for errors - ie, did the snapshot activate ok? Did 
> it release ok?...

*Usually*, a command exits with code 0 if it finishes with a success.

In bash, you can check the exit code with $? variable.

So:


lvmcommand --option1 --option2

if [ $? -eq 0 ] ; then
    do_this
else
    do_that
fi

  parent reply	other threads:[~2008-04-23 13:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-23 13:15 [linux-lvm] Simple scripts for use in automated backups? Charles Marcus
2008-04-23 13:23 ` Dan Kegel
2008-04-23 13:35 ` Tomasz Chmielewski [this message]
2008-04-23 16:12   ` Charles Marcus
2008-04-23 19:18   ` Stuart D. Gathman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=480F3B0F.6010205@wpkg.org \
    --to=mangoo@wpkg.org \
    --cc=linux-lvm@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.