Back up to disk automatically when disk is inserted

Polytropon freebsd at edvax.de
Thu Jan 30 20:20:57 UTC 2020


On Thu, 30 Jan 2020 14:53:20 +0000, Steve O'Hara-Smith wrote:
> On Thu, 30 Jan 2020 14:20:46 +0100
> Polytropon <freebsd at edvax.de> wrote:
> 
> > On Thu, 30 Jan 2020 09:10:35 +0100, Andrea Venturoli wrote:
> > > Failing this, is there some way for my script to check whether the boot 
> > > process has already ended?
> > 
> > You could do the following: Check /var/log/messages and look
> > for the _timestamps_ of
> 
> <snip>
> 
> 	Slightly less inelegant, compare the inode change timestamp of the
> device entry with the last reboot time.
> 
> 	In shell ls -lc /dev/whatsit and last reboot will get the data - if
> they differ by more than a minute it wasn't there at boot.

Your solution is _more_ elegant than mine. The significant
advantage is that the /var/log/messages file might experience
a logfile turnover and therefore be empty. Depending on log
rotation policy, files can be quite big, and grepping requires
more time than parsing a distinct ls output. :-)


-- 
Polytropon
Magdeburg, Germany
Happy FreeBSD user since 4.0
Andra moi ennepe, Mousa, ...


More information about the freebsd-questions mailing list