View previous topic :: View next topic |
Author |
Message |
Seather Apprentice
![Apprentice Apprentice](/images/ranks/rank_rect_2.gif)
![](images/avatars/189011033741a5b7c484428.jpg)
Joined: 23 May 2003 Posts: 194 Location: South Africa
|
Posted: Sat Dec 03, 2005 12:11 am Post subject: Daily glsa-check without updating the whole portage tree |
|
|
Hi there,
I'd like to have glsa-check run daily and email me a list of ports that's being affected by any security issues.
I have managed to do this, and it currently works like this:
Every day, cron runs an `emerge sync' to update the ports tree.
Then I have this perl script running right after that:
Code: | #!/usr/bin/perl -w
@output = `glsa-check -t all 2> /dev/null`;
$count = 1;
$amount_of_security_issues = 0;
if ($output[1]) {
while ($output[$count]) {
$amount_of_security_issues++;
$count++;
}
printf "There are currently $amount_of_security_issues GLSA issues that needs to be sorted out!\n";
} |
Does anyone have a more elegant way of doing this (aside from my script's coding)? My biggest problem here is the amount of bandwidth it is taking per day!
Now, I had an idea, but not 100% sure if it will work. Does glsa-check get everything from /usr/portage/metadata/glsa ?
Because if so, I can have emerge sync ignore everything in /usr/portage except metadata/glsa. Will that do? Anyone know? |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
hanj Veteran
![Veteran Veteran](/images/ranks/rank_rect_5_vet.gif)
![](images/avatars/104414163441b8c6c1a6b4e.gif)
Joined: 19 Aug 2003 Posts: 1500
|
Posted: Wed Dec 07, 2005 6:17 am Post subject: |
|
|
Quote: | I'd like to have glsa-check run daily and email me a list of ports that's being affected by any security issues. |
I just run this...
Code: | /usr/bin/glsa-check -l | grep '\[N\]' |
With this in cron, I'll get a nightly email of affected packages.
Code: |
30 1 * * * /usr/bin/glsa-check -l | grep '\[N\]' |
Quote: | Now, I had an idea, but not 100% sure if it will work. Does glsa-check get everything from /usr/portage/metadata/glsa ? |
Not sure.
Quote: |
Does anyone have a more elegant way of doing this (aside from my script's coding)? My biggest problem here is the amount of bandwidth it is taking per day! |
I'm guessing you're talking about the large output from emerge sync in your email?
This is my cron for emerge sync and emerge world. I just send the output of emerge sync to dev/null, and send the output of emerge world in an email
Code: | 0 3 * * * /usr/bin/emerge sync > /dev/null 2>&1
30 3 * * * /usr/bin/emerge -uvDpl world |
HTH
hanji |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|