Cron?

Alexander Skwar alexanders.mailinglists+nospam at gmail.com
Thu Aug 2 15:12:07 UTC 2012


Hi

On Thu, Aug 2, 2012 at 5:00 PM, Knute Johnson <ubuntu at knutejohnson.com>wrote:

>
>
> The reason I ask is that I have a jump drive backup that I mount to back
> up to and can't have mounted when I do the fsck on it once a month.



Well, in that case, I'd write the fsck script in such a way, that either
aborts if the filesystem is mounted or that it waits until filesystem
got unmounted.

# Check out /dev/disk/by-id for this
jump_drive_id="ata-WDC_WD1002FAEX-00Y9A0_WD-WCAW32263803"
jump_drive_id_dev="/dev/disk/by-id/$jump_drive_id"

while mount | grep $( readlink -f "$jump_drive_id_dev" ); do
  # jump drive is still mounted
  # wait a bit
  sleep 42
  # or abort
  # exit 1
done
# jump drive is not mounted
fsck "$jump_drive_id_dev"
# Done
exit $?
# EOF


Or something like that…

Alexander
-- 
↯    Lifestream (Twitter, Blog, …) ↣ http://alexs77.soup.io/     ↯
↯ Chat (Jabber/Google Talk) ↣ a.skwar at gmail.com , AIM: alexws77  ↯
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20120802/bcacfac9/attachment.html>


More information about the ubuntu-users mailing list