From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 52664138330 for ; Fri, 12 Jan 2018 16:57:05 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BCD51E09C2; Fri, 12 Jan 2018 16:56:58 +0000 (UTC) Received: from blaine.gmane.org (unknown [195.159.176.226]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 4F534E086D for ; Fri, 12 Jan 2018 16:56:58 +0000 (UTC) Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1ea2bN-0004dx-89 for gentoo-user@lists.gentoo.org; Fri, 12 Jan 2018 17:54:45 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: gentoo-user@lists.gentoo.org From: Grant Edwards Subject: [gentoo-user] Re: OT: cleanup after USB backup drive unplugged? Date: Fri, 12 Jan 2018 16:54:33 +0000 (UTC) Message-ID: References: <2816840.ivPOrxIB2h@dell_xps> <5A58E571.8050408@youngman.org.uk> X-Complaints-To: usenet@blaine.gmane.org User-Agent: slrn/1.0.2 (Linux) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org X-Archives-Salt: bac2459d-c57a-4186-8255-319ecc517ea7 X-Archives-Hash: 4b148d7331d104b385f09b2b8c194791 On 2018-01-12, Wols Lists wrote: > On 12/01/18 15:39, Grant Edwards wrote: >>>> I usually also include a check to ensure that some file/directory >>>> exists which I expect to be on the drive, which prevents the >>>> backup script from dumping a full backup into your mountpoint if >>>> it isn't mounted (possibly on a filesystem with insufficient >>>> space - > >> Yep, that's being done. The backup won't attempt to run if the >> external drive isn't mounted. > > Dunno quite how it works, but you could automate everything through > udev. Yes, that's what I was doing. The original question was what action should udev take when a USB drive is unplugged. As somebody pointed out, it's probably safer to explicity mount the drive as part of the backup operation then unmount when the backup is finished. Now, instead of having udev mount the drive when it's plugged in, the backup script handles that. > Or, of course, if your backup expects the drive at that location, it > simply refuses to run if that location doesn't exist. Right. -- Grant Edwards grant.b.edwards Yow! Is it NOUVELLE at CUISINE when 3 olives are gmail.com struggling with a scallop in a plate of SAUCE MORNAY?