Re: Replace cron with systemd timer unit?

2017-08-04 Thread Paul Wise
On Thu, Aug 3, 2017 at 9:19 PM, Ben Finney wrote:

> If the cron job is removed – necessarily entailed by “replace it”,
> surely? – then how can they continue to use it after it is replaced by
> something else?

I would discourage removal of the cron job, but it could still be
replaced by a systemd timer when running under systemd, without
removing the cron job, so machines running sysvinit+cron can work the
same.

The example I gave of apt has a cron job script that exits quickly
when run under systemd and for sysvinit it reimplements the features
of systemd that the apt systemd timer uses (require AC power,
randomise start time) and then calls the same script that the apt
systemd service uses.

-- 
bye,
pabs

https://wiki.debian.org/PaulWise



Re: Replace cron with systemd timer unit?

2017-08-03 Thread Ben Finney
Ben Hildred <426...@gmail.com> writes:

> On Thu, Aug 3, 2017 at 11:20 AM, Ricardo Fraile  wrote:
>
> > The tuptime package have a cron file in it and I am thinking on
> > replace it with a systemd timer unit.


Paul Wise  writes:

> On Thu, Aug 3, 2017 at 1:53 PM, Ben Hildred wrote:
>
> > You do realise that there are people who do not run systemd?
>
> They can use the cron job as usual.

If the cron job is removed – necessarily entailed by “replace it”,
surely? – then how can they continue to use it after it is replaced by
something else?

-- 
 \   “A ‘No’ uttered from deepest conviction is better and greater |
  `\   than a ‘Yes’ merely uttered to please, or what is worse, to |
_o__)  avoid trouble.” —Mohandas K. Gandhi |
Ben Finney



Re: Replace cron with systemd timer unit?

2017-08-03 Thread Adam Borowski
On Thu, Aug 03, 2017 at 11:24:40AM -0700, Herminio Hernandez, Jr. wrote:
> The Arch Wiki
> 
> shows how you can integrate email notifications with .timer

Yes, but Arch is systemd only, while Debian (thanks Eris!) is not.

Thus, you need cron anyway.

And, you have two choices:
* maintain and test cron job only
* maintain and test both cron and .timer

The former is obviously less work.  Thus, the latter makes sense only if
there's a specific optional feature of .timer you want, and you think it's
worth the effort to handle both.


Meow!
-- 
⢀⣴⠾⠻⢶⣦⠀ What Would Jesus Do, MUD/MMORPG edition:
⣾⠁⢰⠒⠀⣿⡁ • multiplay with an admin char to benefit your mortal
⢿⡄⠘⠷⠚⠋⠀ • abuse item cloning bugs (the five fishes + two breads affair)
⠈⠳⣄ • use glitches to walk on water



Re: Replace cron with systemd timer unit?

2017-08-03 Thread PICCORO McKAY Lenz
this will change all the way whitin debian can be a unix like!

its enought of systemd intrution!

Lenz McKAY Gerardo (PICCORO)
http://qgqlochekone.blogspot.com

2017-08-03 14:24 GMT-04:00 Herminio Hernandez, Jr. <
herminio.hernande...@gmail.com>:

> The Arch Wiki
> 
> shows how you can integrate email notifications with .timer
>
> On Thu, Aug 3, 2017 at 11:00 AM, Paul Wise  wrote:
>
>> On Thu, Aug 3, 2017 at 1:20 PM, Ricardo Fraile wrote:
>>
>> > I like some aspects of the .timer, but I don't know if the change is a
>> good
>> > idea or not at this moment? There are any other package that has changed
>> > from cron to .timer? What is the official recomendation?
>>
>> One significant difference between the two is that all cron output is
>> sent via email, while output from systemd timers is not sent via
>> email. There is no official recommendation here, but other packages
>> have migrated from cron to systemd timers, with fallback to cron when
>> systemd is not running. You can see the apt package for an example and
>> there is also systemd-cron, which can be used to generate systemd
>> timers from cron jobs, the results are placed in the
>> /run/systemd/generator directory at boot time.
>>
>> --
>> bye,
>> pabs
>>
>> https://wiki.debian.org/PaulWise
>>
>>
>


Re: Replace cron with systemd timer unit?

2017-08-03 Thread Herminio Hernandez, Jr.
The Arch Wiki

shows how you can integrate email notifications with .timer

On Thu, Aug 3, 2017 at 11:00 AM, Paul Wise  wrote:

> On Thu, Aug 3, 2017 at 1:20 PM, Ricardo Fraile wrote:
>
> > I like some aspects of the .timer, but I don't know if the change is a
> good
> > idea or not at this moment? There are any other package that has changed
> > from cron to .timer? What is the official recomendation?
>
> One significant difference between the two is that all cron output is
> sent via email, while output from systemd timers is not sent via
> email. There is no official recommendation here, but other packages
> have migrated from cron to systemd timers, with fallback to cron when
> systemd is not running. You can see the apt package for an example and
> there is also systemd-cron, which can be used to generate systemd
> timers from cron jobs, the results are placed in the
> /run/systemd/generator directory at boot time.
>
> --
> bye,
> pabs
>
> https://wiki.debian.org/PaulWise
>
>


Re: Replace cron with systemd timer unit?

2017-08-03 Thread Paul Wise
On Thu, Aug 3, 2017 at 1:53 PM, Ben Hildred wrote:

> You do realise that there are people who do not run systemd?

They can use the cron job as usual.

-- 
bye,
pabs

https://wiki.debian.org/PaulWise



Re: Replace cron with systemd timer unit?

2017-08-03 Thread Paul Wise
On Thu, Aug 3, 2017 at 1:20 PM, Ricardo Fraile wrote:

> I like some aspects of the .timer, but I don't know if the change is a good
> idea or not at this moment? There are any other package that has changed
> from cron to .timer? What is the official recomendation?

One significant difference between the two is that all cron output is
sent via email, while output from systemd timers is not sent via
email. There is no official recommendation here, but other packages
have migrated from cron to systemd timers, with fallback to cron when
systemd is not running. You can see the apt package for an example and
there is also systemd-cron, which can be used to generate systemd
timers from cron jobs, the results are placed in the
/run/systemd/generator directory at boot time.

-- 
bye,
pabs

https://wiki.debian.org/PaulWise



Re: Replace cron with systemd timer unit?

2017-08-03 Thread Ben Hildred
On Thu, Aug 3, 2017 at 11:20 AM, Ricardo Fraile  wrote:

> Hi,
>
>
> The tuptime package have a cron file in it and I am thinking on replace it
> with a systemd timer unit.
>
> In the Debian Policy there are only references to cron, the same as in the
> Developers Reference Guide and Maintainer Guide.
>
> I like some aspects of the .timer, but I don't know if the change is a
> good idea or not at this moment? There are any other package that has
> changed from cron to .timer? What is the official recomendation?
>
>
> Thanks,
>

You do realise that there are people who do not run systemd?

-- 
--
Ben Hildred
Automation Support Services


Replace cron with systemd timer unit?

2017-08-03 Thread Ricardo Fraile
Hi, 

The tuptime package have a cron file in it and I am thinking on replace
it with a systemd timer unit. 

In the Debian Policy there are only references to cron, the same as in
the Developers Reference Guide and Maintainer Guide. 

I like some aspects of the .timer, but I don't know if the change is a
good idea or not at this moment? There are any other package that has
changed from cron to .timer? What is the official recomendation? 

Thanks,