Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Daily glsa-check without updating the whole portage tree
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
Seather
Apprentice
Apprentice


Joined: 23 May 2003
Posts: 194
Location: South Africa

PostPosted: Sat Dec 03, 2005 12:11 am    Post subject: Daily glsa-check without updating the whole portage tree Reply with quote

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
View user's profile Send private message
hanj
Veteran
Veteran


Joined: 19 Aug 2003
Posts: 1500

PostPosted: Wed Dec 07, 2005 6:17 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
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