Am Mon, 2 Mar 2015 05:13:26 +0000 (UTC) schrieb Duncan <1i5t5.duncan@cox.net>: > Rich Freeman posted on Sun, 01 Mar 2015 14:13:53 -0500 as excerpted: > > > On Sun, Mar 1, 2015 at 1:20 PM, Marc Joliet wrote: > >> > >> Regardless: thoughts? > > > > I'd probably just do this: > >> Am Sun, 1 Mar 2015 08:34:19 -0500 schrieb Rich Freeman > >> : > >>> > >>> The timer keeps running if you set the dependency on the service. So, > >>> next time the timer runs, it will try again. You might want to just > >>> set an hourly job and have it check for a successful run in the last > >>> day or whatever. > >>> > > You could of course trigger this from either the mount or hourly. > > Anytime you mount the drive or every hour systemd will run the service, > > and the service will see if it managed to do a backup/etc in the last > > day/week/whatever, and then run if appropriate. > > This is actually how I setup several former cron-jobs as systemd timers, > here, based on an hourly check somewhat similar to what most crons > (including gentoo's for over 10 years now and mandrake's before that) are > actually setup to do to get around the fact that cron won't on-its-own > trigger after restart if the machine was down or cron not running when > the configured time for a job ran. > > Here's how I have it setup here. Note that my initials are jed, and I > use them regularly as a prefix/suffix to denote custom configs (here, > systemd units) I've created myself, as opposed to those shipped in > whatever package. > [GIGASNIP thorough explanation ;) ] I pretty much thought that's what Rich was alluding to, but thanks for showing that it's not *that* much extra complication (and how one can use a target unit for this). I never really looked at how these things are done by run-crons (and similar). Just for completeness: I use fcron instead of vixie-cron, so some of the stuff systemd timers can do was already known to me. For example, in fcron, lines can start with "@" to denote that they run relative to system startup (e.g, "@ 5" for "every five minutes after boot). The "first" option specifies how long to wait before starting an entry for the first time, analogous to "OnBootSec". Anyway, like I mentioned before, I'll revisit this once I've solved the HDD problem (or not, if it turns out to be a firmware issue). Greetings -- Marc Joliet -- "People who think they know everything really annoy those of us who know we don't" - Bjarne Stroustrup