Discussion:
[rancid] Daily Difference Digest?
Tyler Christiansen
2013-10-23 05:31:18 UTC
Permalink
Hello!

Apologies if this has been asked, but searching the web doesn't turn up
much (and it's made more difficult by the fact that searching for 'rancid
difference daily digest' and similar items turns up nothing but stomach
digestion information!).

Is it possible to configure Rancid to e-mail differences in a daily digest
format? We might make several small changes throughout the day, and
instead of getting e-mailed every time we make a change, I'd like to get a
summary of all changes for the entire day.

Thanks for any tips/help/advice/etc!

--Tyler
Alan McKinnon
2013-10-23 08:35:53 UTC
Permalink
Post by Tyler Christiansen
Hello!
Apologies if this has been asked, but searching the web doesn't turn up
much (and it's made more difficult by the fact that searching for
'rancid difference daily digest' and similar items turns up nothing but
stomach digestion information!).
Is it possible to configure Rancid to e-mail differences in a daily
digest format? We might make several small changes throughout the day,
and instead of getting e-mailed every time we make a change, I'd like to
get a summary of all changes for the entire day.
Thanks for any tips/help/advice/etc!
To the best of my knowledge rancid doesn't do that natively. It would be
hard to code it, as rancid uses the classic method to send mail: print
text and pipe it to a mailer. To digest, rancid would have to store
mails somewhere and gather them up once a day in a cron

Digest is best done in your mail system, not in your rancid system. The
method I use is to send all rancid mail to a Mailman instance and tell
the users to sign themselves up. They can choose digest or individual
mails as they prefer and I don't have to get involved.

Many other possible solutions exist, depending on how big your setup is,
how many devices and users, etc.
--
Alan McKinnon
***@gmail.com
Paul Gear
2013-10-23 09:52:08 UTC
Permalink
Post by Alan McKinnon
Post by Tyler Christiansen
Hello!
Apologies if this has been asked, but searching the web doesn't turn up
much (and it's made more difficult by the fact that searching for
'rancid difference daily digest' and similar items turns up nothing but
stomach digestion information!).
Is it possible to configure Rancid to e-mail differences in a daily
digest format? We might make several small changes throughout the day,
and instead of getting e-mailed every time we make a change, I'd like to
get a summary of all changes for the entire day.
Thanks for any tips/help/advice/etc!
To the best of my knowledge rancid doesn't do that natively. It would be
hard to code it, as rancid uses the classic method to send mail: print
text and pipe it to a mailer. To digest, rancid would have to store
mails somewhere and gather them up once a day in a cron
Digest is best done in your mail system, not in your rancid system. The
method I use is to send all rancid mail to a Mailman instance and tell
the users to sign themselves up. They can choose digest or individual
mails as they prefer and I don't have to get involved.
Many other possible solutions exist, depending on how big your setup is,
how many devices and users, etc.
I like Alan's suggestion about Mailman. Here's another: don't email
changes to everyone - just put them in a mailbox that receives the email.

Then set up a separate process to run once a day which just does a diff
from the top of each svn repository where you store RANCID configs (i.e.
one for each group). Email this to all the people who need the daily
digest.

Paul
James Bensley
2013-10-23 10:57:17 UTC
Permalink
Post by Alan McKinnon
To the best of my knowledge rancid doesn't do that natively. It would be
hard to code it, as rancid uses the classic method to send mail: print
text and pipe it to a mailer.
It depends on what functionality you wanted. If you wanted all rancid
emails to be a daily digest then it would be easy. Edit he rancid
script that echo's to "| mail" (I forget which script it is but I've
changed it before easily enough) and add an "if" statement, "if hour
== 5.30pm, echo $changed | mail" - Assume you finished at 5.30pm each
day and that is when you want your rancid emails to come through. I
have rancid run every hour, so "if time > 5pm < 6pm; send the email".

Cheers,
James.
Alan McKinnon
2013-10-23 11:58:00 UTC
Permalink
Post by James Bensley
Post by Alan McKinnon
To the best of my knowledge rancid doesn't do that natively. It would be
hard to code it, as rancid uses the classic method to send mail: print
text and pipe it to a mailer.
It depends on what functionality you wanted. If you wanted all rancid
emails to be a daily digest then it would be easy. Edit he rancid
script that echo's to "| mail" (I forget which script it is but I've
changed it before easily enough) and add an "if" statement, "if hour
== 5.30pm, echo $changed | mail" - Assume you finished at 5.30pm each
day and that is when you want your rancid emails to come through. I
have rancid run every hour, so "if time > 5pm < 6pm; send the email".
Surely that mails out only changes detected in the last run, excluding
all others earlier in the day?

To get everything today as a digest you'd need to do a CVS diff against
the repo as at 6pm yesterday
--
Alan McKinnon
***@gmail.com
James Bensley
2013-10-23 12:50:22 UTC
Permalink
It depends, I know the op wanted all the changes made so you are
right, my method was as you said for just one daily email of the most
recent changes. I still don't think that would be a massive issue to
code it.

Just my two pence.

Cheers,
James.
heasley
2013-10-23 14:49:15 UTC
Permalink
Post by Alan McKinnon
To the best of my knowledge rancid doesn't do that natively. It would be
hard to code it, as rancid uses the classic method to send mail: print
i definitely do not want it in rancid. many have solved this problem and
each will want it done differently.
Post by Alan McKinnon
text and pipe it to a mailer. To digest, rancid would have to store
mails somewhere and gather them up once a day in a cron
in its simplest form

min hr * * * cd ~rancid/group; cvs diff -D "24 hours ago" | Mail -s "daily diffs" rancid-group
Post by Alan McKinnon
Digest is best done in your mail system, not in your rancid system. The
method I use is to send all rancid mail to a Mailman instance and tell
the users to sign themselves up. They can choose digest or individual
mails as they prefer and I don't have to get involved.
this is the way to do it, imo. it also means that changes applied and
removed/overridden have less chance of being hidden.

Roy
2013-10-23 13:21:36 UTC
Permalink
Post by Tyler Christiansen
Hello!
Apologies if this has been asked, but searching the web doesn't turn
up much (and it's made more difficult by the fact that searching for
'rancid difference daily digest' and similar items turns up nothing
but stomach digestion information!).
Is it possible to configure Rancid to e-mail differences in a daily
digest format? We might make several small changes throughout the
day, and instead of getting e-mailed every time we make a change, I'd
like to get a summary of all changes for the entire day.
Thanks for any tips/help/advice/etc!
--Tyler
I only run rancid one a day :-)

Here is a suggestion. You set up two copies of rancid. One runs daily
and the other more frequently. The one that runs more frequently sends
the diff files to /dev/null.
Loading...