Date: Thu, 30 Jan 2020 14:20:46 +0100 From: Polytropon <freebsd@edvax.de> To: Andrea Venturoli <ml@netfence.it> Cc: freebsd-questions@freebsd.org Subject: Re: Back up to disk automatically when disk is inserted Message-ID: <20200130142046.c1dc5c57.freebsd@edvax.de> In-Reply-To: <12be8560-91ac-f800-4ca2-84175227d280@netfence.it> References: <12be8560-91ac-f800-4ca2-84175227d280@netfence.it>
next in thread | previous in thread | raw e-mail | index | archive | help
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 1. system boot messages (pick a unique one) 2. disk insertion messages (pick suiting one) If the timestamps are within a certain range, the disk must have been inserted already, so the backup script would exit. If not, i. e., message timestamps differ "too much", the disk has been inserted "just now" (you can compare this with the _current_ system time), and the backup process can begin. I know, very unelegant, but will probably work. This is the case of makeshift workarounds that lasts forever... ;-) -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20200130142046.c1dc5c57.freebsd>