Re: [GTALUG] Crontab versioning

2018-05-03 Thread Kevin Cozens via talk

On 2018-05-03 11:44 PM, William Park via talk wrote:

Couldn't you do something like
 cp file file--$(date +%F_%T)


For single file version control you could use the old RCS set of programs.

--
Cheers!

Kevin.

http://www.ve3syb.ca/   | "Nerds make the shiny things that
https://www.patreon.com/KevinCozens | distract the mouth-breathers, and
| that's why we're powerful"
Owner of Elecraft K2 #2172  |
#include  | --Chris Hardwick
---
Talk Mailing List
talk@gtalug.org
https://gtalug.org/mailman/listinfo/talk


Re: [GTALUG] Crontab versioning

2018-05-03 Thread William Park via talk
Couldn't you do something like 
cp file file--$(date +%F_%T)
?
-- 
William Park 

On Thu, May 03, 2018 at 10:44:57AM -0400, Alex Beamish via talk wrote:
> I'm developing scripts that get run by crontab, so I'm in there making
> updates fairly regularly. I would love to be able to document the changes,
> so I'm wondering if there a usual and customary technique to version
> crontabs?
> 
> Ideally there would be some sort of hook around 'crontab -e', but failing
> that, I'd have the output of 'crontab -l' (run regularly by cron?) go to a
> versioned file. Plan B sounds a bit hokey to me.
> 
> -- 
> Alex Beamish
> 
> Software Developer / https://ca.linkedin.com/in/alex-beamish-5111ba3
> Speaker Wrangler, Toronto Perlmongers / http://to.pm.org/
> Baritone, Board Member, Toronto Northern Lights, 2013 Champions /
> www.northernlightschorus.com
> Certified Contest Administrator, Barbershop Harmony Society /
> www.barbershop.org

> ---
> Talk Mailing List
> talk@gtalug.org
> https://gtalug.org/mailman/listinfo/talk
---
Talk Mailing List
talk@gtalug.org
https://gtalug.org/mailman/listinfo/talk


Re: [GTALUG] Crontab versioning

2018-05-03 Thread Clifford Ilkay via talk
On Thu, May 3, 2018 at 10:44 AM, Alex Beamish via talk 
wrote:

> I'm developing scripts that get run by crontab, so I'm in there making
> updates fairly regularly. I would love to be able to document the changes,
> so I'm wondering if there a usual and customary technique to version
> crontabs?
>
> Ideally there would be some sort of hook around 'crontab -e', but failing
> that, I'd have the output of 'crontab -l' (run regularly by cron?) go to a
> versioned file. Plan B sounds a bit hokey to me.
>


I do this using git and SaltStack. Here is my Salt state for managing the
root crontab.

 cron:
service.running:
- name: cron
- enable: True

root-crontab:
file.managed:
- name: /root/root-crontab
- source: salt://cronjobs/root-crontab
- template: jinja
cmd.run:
- name: cd /root; /usr/bin/crontab -r; /usr/bin/crontab root-crontab

The file called root-crontab is under revision control. One of the things
that is in root-crontab is first, updating the Salt states and second,
invoking them. That could include updating the root-crontab. There are
other ways of doing this in SaltStack.

Regards,

Clifford Ilkay

+1 647-778-8696
---
Talk Mailing List
talk@gtalug.org
https://gtalug.org/mailman/listinfo/talk


Re: [GTALUG] Upgraded to Beaver and Command Line Says 'command not found'

2018-05-03 Thread Evan Leibovitch via talk
There's always the path I took ... avoiding the GNOME / MATE / Unity soap
opera altogether.

Kubuntu 18.04 works just fine.

On Thu, 3 May 2018 at 12:35, Val Kulkov via talk  wrote:

> On 3 May 2018 at 09:57, Evan Leibovitch via talk  wrote:
> >
> > On Wed, 2 May 2018 at 15:40, Lennart Sorensen via talk 
> wrote:
> >
> >>
> >> No idea what Beaver is.  Did Ubuntu wrap the alphabet or something?
> >
> >
> > Yes. The current revision as of last week is 18.04 Bionic Beaver -- a
> major (LTS) release
> >
>
> Not intending to open up the discussion of Gnome vs Unity, simply
> expressing my own personal opinion about 18.04 Bionic Beaver choice of
> Gnome.
>
> Gnome 3.28 feels like a significant downgrade to me, coming from 16.04
> Unity interface. I played with it for a few days in an honest attempt
> to get used to it and make the most use of it. No, I am missing too
> many time-savers from Unity. I am missing my Thunderbird icon in the
> system tray. Finally, I gave up and switched back to Unity + compiz
> and now I am happy again.
>
> The good thing though is that, once Unity is installed on 18.04, you
> get to choose to login to Unity or to Gnome/X or even to Gnome/Wayland
> in case you want to continue playing around with Gnome.
> ---
> Talk Mailing List
> talk@gtalug.org
> https://gtalug.org/mailman/listinfo/talk
>


-- 
Evan Leibovitch, Toronto Canada
@evanleibovitch or @el56
---
Talk Mailing List
talk@gtalug.org
https://gtalug.org/mailman/listinfo/talk


Re: [GTALUG] Crontab versioning

2018-05-03 Thread Christopher Browne via talk
On Thu, 3 May 2018 at 10:45, Alex Beamish via talk  wrote:

> I'm developing scripts that get run by crontab, so I'm in there making
updates fairly regularly. I would love to be able to document the changes,
so I'm wondering if there a usual and customary technique to version
crontabs?

> Ideally there would be some sort of hook around 'crontab -e', but failing
that, I'd have the output of 'crontab -l' (run regularly by cron?) go to a
versioned file. Plan B sounds a bit hokey to me.

Some years back, I built a bit of infrastructure for this.

We didn't have git at the time (heh, AIX was involved.  It's always quite
the chase to get things running on AIX! ;-) )

I did a combination of push *and* pull on my crontabs:

a) I had tooling (integrated using cfengine 2, which tells you how far
back! ;-) ) to add desired entries into files.  So I used this to modify a
copy of the crontab to make sure that the copy included Stuff I Wanted.

This represents the "push"; have a way to push things in.

But my push was into a *copy*, not the real file...

b) Also, nice to have a "pull"

If git had been an option, I'd have taken the present contents of crontab,
exported via "crontab -l", stow that in git, as a preface to step a).

instead, I'd pull the present contents, see if it was different from the
latest recorded version, and if so, rename the previous one to mark when it
was obsolesced.

Then rewrite via a), and use "crontab < authoritative_new_version" to
update cron on the new schedule.

If one uses an SCM, then that changes a few steps, but not in any huge way.

In these modern days, it probably isn't "cfagent+script", but rather "git +
ansible/salt/..."

-- 
When confronted by a difficult problem, solve it by reducing it to the
question, "How would the Lone Ranger handle this?"
---
Talk Mailing List
talk@gtalug.org
https://gtalug.org/mailman/listinfo/talk


Re: [GTALUG] Crontab versioning

2018-05-03 Thread Jason Shaw via talk
I'd recommend using git or a similar version control system, and then have
some sort of configuration management tool like ansible put it in place on
the server.

-jason

On Thu, May 3, 2018 at 10:44 AM, Alex Beamish via talk 
wrote:

> I'm developing scripts that get run by crontab, so I'm in there making
> updates fairly regularly. I would love to be able to document the changes,
> so I'm wondering if there a usual and customary technique to version
> crontabs?
>
> Ideally there would be some sort of hook around 'crontab -e', but failing
> that, I'd have the output of 'crontab -l' (run regularly by cron?) go to a
> versioned file. Plan B sounds a bit hokey to me.
>
> --
> Alex Beamish
>
> Software Developer / https://ca.linkedin.com/in/alex-beamish-5111ba3
> Speaker Wrangler, Toronto Perlmongers / http://to.pm.org/
> Baritone, Board Member, Toronto Northern Lights, 2013 Champions /
> www.northernlightschorus.com
> Certified Contest Administrator, Barbershop Harmony Society /
> www.barbershop.org
>
>
> ---
> Talk Mailing List
> talk@gtalug.org
> https://gtalug.org/mailman/listinfo/talk
>
>
---
Talk Mailing List
talk@gtalug.org
https://gtalug.org/mailman/listinfo/talk


Re: [GTALUG] Upgraded to Beaver and Command Line Says 'command not found'

2018-05-03 Thread Val Kulkov via talk
On 3 May 2018 at 09:57, Evan Leibovitch via talk  wrote:
>
> On Wed, 2 May 2018 at 15:40, Lennart Sorensen via talk  
> wrote:
>
>>
>> No idea what Beaver is.  Did Ubuntu wrap the alphabet or something?
>
>
> Yes. The current revision as of last week is 18.04 Bionic Beaver -- a major 
> (LTS) release
>

Not intending to open up the discussion of Gnome vs Unity, simply
expressing my own personal opinion about 18.04 Bionic Beaver choice of
Gnome.

Gnome 3.28 feels like a significant downgrade to me, coming from 16.04
Unity interface. I played with it for a few days in an honest attempt
to get used to it and make the most use of it. No, I am missing too
many time-savers from Unity. I am missing my Thunderbird icon in the
system tray. Finally, I gave up and switched back to Unity + compiz
and now I am happy again.

The good thing though is that, once Unity is installed on 18.04, you
get to choose to login to Unity or to Gnome/X or even to Gnome/Wayland
in case you want to continue playing around with Gnome.
---
Talk Mailing List
talk@gtalug.org
https://gtalug.org/mailman/listinfo/talk


[GTALUG] Crontab versioning

2018-05-03 Thread Alex Beamish via talk
I'm developing scripts that get run by crontab, so I'm in there making
updates fairly regularly. I would love to be able to document the changes,
so I'm wondering if there a usual and customary technique to version
crontabs?

Ideally there would be some sort of hook around 'crontab -e', but failing
that, I'd have the output of 'crontab -l' (run regularly by cron?) go to a
versioned file. Plan B sounds a bit hokey to me.

-- 
Alex Beamish

Software Developer / https://ca.linkedin.com/in/alex-beamish-5111ba3
Speaker Wrangler, Toronto Perlmongers / http://to.pm.org/
Baritone, Board Member, Toronto Northern Lights, 2013 Champions /
www.northernlightschorus.com
Certified Contest Administrator, Barbershop Harmony Society /
www.barbershop.org
---
Talk Mailing List
talk@gtalug.org
https://gtalug.org/mailman/listinfo/talk


Re: [GTALUG] Upgraded to Beaver and Command Line Says 'command not found'

2018-05-03 Thread Evan Leibovitch via talk
On Wed, 2 May 2018 at 15:40, Lennart Sorensen via talk 
wrote:


> No idea what Beaver is.  Did Ubuntu wrap the alphabet or something?
>

​Yes. The current revision as of last week is 18.04 Bionic Beaver -- a
major (LTS) release​

-- 
Evan Leibovitch, Toronto Canada
@evanleibovitch or @el56
---
Talk Mailing List
talk@gtalug.org
https://gtalug.org/mailman/listinfo/talk