Cron?
Knute Johnson
ubuntu at knutejohnson.com
Thu Aug 2 15:45:37 UTC 2012
On 8/2/2012 8:12 AM, Alexander Skwar wrote:
> Hi
>
> On Thu, Aug 2, 2012 at 5:00 PM, Knute Johnson <ubuntu at knutejohnson.com
> <mailto: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
Thanks very much.
--
Knute Johnson
More information about the ubuntu-users
mailing list