On 2014-08-15 20:56, wolfi323 wrote:
>
> robin_listas;2659399 Wrote:
>>> I think we are talking about different things then.
>>
>> No, actually the same thing
> No. What you described is done by run-crons.
> I was talking about the actual script that cleans /tmp, which is called
> by cron/run-crons once a day.
Yes, same as me.
Cron parses /etc/crontab, which has an entry to run run-crons, which
then runs /etc/cron.daily/suse.de-clean-tmp.
Cron never calls any script in /etc/cron.daily/ directly.
>> Does clean up happen at 06:15? I guess not, because the machine has not
>> been running 24 hours, despite the uptime command saying “1 day, 6
>> hours”
> That’s how I understand it, yes.
> It won’t run it on 06:15, because that was no boot.
>
>> I guess that clean up would happen whenever 24 hours actual running time
>> is reached, right? Could be today, or in weeks, if the machine only runs
>> one hour per day.
> Yes, that’s what I think.
>
>> You see, the “definition” is not clear at all
> Well, “cron”'s definition was not clear at all either (as I said there
> are several implementations with possibly differing behavior). ;=)
> AFAIK the original cron didn’t run jobs at all that are scheduled for a
> time when the system is not running.
Correct.
> SUSE’s run-crons script might in fact be necessary only because of
> missing features in cron…
Yes, that is so.
There is an alternative cron daemon which does, though: anacron.
> OTOH, it actually depends on the job at hand which bahavior would be the
> correct one in such a case.
> F.e. if you have a job that plays a jingle at 12h to remind you that
> it’s 12 o’clock, it makes no sense to run that later when the machine
> was turned off/hibernated at that time.
> So it’s hard/impossible to define a behavior that’s correct under all
> circumstances.
> But at least there is a well-defined behavior in systemd.timer.
I prefer the suse implementation of cron scripts. In my scenario above
of hibernation, it would still run at my preferred hour range, but
another day. With systemd, the actual time of running delays for several
days, even weeks.
>
> Btw, it is possible to tell systemd.timer to run the service every day
> at 12:30 f.e., or hourly, yearly, … similar to cron :
>> OnCalendar=
>> Defines realtime (i.e. wallclock) timers via calendar event
>> expressions. See systemd.time(7) for more information on the syntax
>> of calendar event expressions. Otherwise the semantics are similar
>> to OnActiveSec= and related settings.
Ah? That is interesting.
> No idea what exactly that means in the case that the system is not
> running at that time though…:
>
> But I think this is getting far off-topic now. The thread is about
> cleaning /tmp at boot time. Not about how cron/systemd.timer should
> behave.
Well, if we want to write/insert a deletion job, we have to know where
and how to do it…
–
Cheers / Saludos,
Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)