bibledit-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [be] remote repository difficulties (checking a filesystem is mounte


From: Jonathan Marsden
Subject: Re: [be] remote repository difficulties (checking a filesystem is mounted )
Date: Sat, 21 Jan 2012 19:37:36 -0800
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Thunderbird/3.1.16

On 01/21/2012 03:55 PM, Kim Blewett wrote:

> I've had this happen in another situation: A script issues a command
> to rsync (in my case) to /media/xxx, but the device that should be
> mounted there is NOT mounted. Somehow a folder with that name gets
> created in /media and written to.


You don't have to put up with that.

You can test for it in the script, with something like:

if mount |grep -sq " on /media/xxx"
then
  rsync -flags source destination # whatever-stuff-goes-here
else
  logger -sp user.error -t ${0##*/} ERROR: /media/xxx is not mounted
  exit 1
fi

You can do whatever error recovery you want in the else part, such as
logging via syslog using logger (as I did above), or emailing an admin,
or whatever action(s) you want to happen :)

Jonathan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]