Jump to content

Automatic updates script [solved]


Recommended Posts

Hi.

 

I read posts about this thread on this forum, I just want to take them a bit further.

System Updates Startup-Script [solved], How could I do this?

Auto update

 

1. I want to configure my computer to check for updates daily (that is explained in those threads above, consider this one solved)

2. I want to get mail with other msec security warnings daily (it would be better if i get them in the same mail as those, not in a new one) with all packages that were updated, and if some server could not be contacted, I can run update manually or if the server has been dropped out permanently, I can pick a new one from Easy-Urpmi

3. I want to set urpmi not to update packages which contain text like "kernel", "kernel-source", "irssi" etc. because I want to update them manually if there's any need for them

 

I were thinking that the script would look like this:

 

urpmi.update -a
urpmi --auto-select --auto --skip kernel kernel-source irssi

 

Is it right?

And what about that mail? A log file would be another option.

 

PS. This is all about learning, just want to learn a bit more of these things.

 

edit: [solved]

 

Thanks.

-Murda

Edited by Murda
Link to comment
Share on other sites

My script just reads:

 

urpmi.update -a
urpmi --update --auto-select --auto

 

and works perfectly fine for me. Set in /etc/cron.daily. Once script has been created, don't forget to:

 

chmod +x scriptfilename

 

Of course, incorporate the skip for things you don't want to update. kernel-source is the only thing to update, kernel will not.

Link to comment
Share on other sites

2. it´s saver not to send security reports over the internet (these are not encrypted in anyway). Better use a local mail folder. So in te MCC instead of your email adress put your username and in your mail program (for example kmail) create a local mail acount (so not pop3 but local).

 

3. In /etc/config/urpmi (or something like that, can´t check the correct path right now) there is a blacklist where you can add packages that won´t be updated.

Link to comment
Share on other sites

2. it´s saver not to send security reports over the internet (these are not encrypted in anyway). Better use a local mail folder. So in te MCC instead of your email adress put your username and in your mail program (for example kmail) create a local mail acount (so not pop3 but local).

 

Actually, my msec sends those reports to a local mailbox. I have postfix up and running. I've configured that in MCC to send them to "murda", not "murda@somewhere.net".

 

I'm sorry that I didn't mention this before.

 

But the question still remains, how can I put those reports that urpmi gives to my mailbox?

 

Thanks, Murda.

Link to comment
Share on other sites

Normally, you need to update /etc/aliases so that root: is pointing to murda. Then run /usr/bin/newaliases. Then it will end up in your mailbox.

 

But how do i make that urpmi installation output to go to that mailbox? root is already pointing to a mailbox named murda. Is there a local folder somewhere where I could dump log files and they appear as mail?

 

I just found out that i don't need any information about installed packages. Msec runs a Diff check every night and reports those packages that have been modified, installed or deleted.

 

The only thing now that would be nice is getting those error messages to a mailbox. Or is msec doing that too? At least i've never seen a mail like that (got some errors though when updating manually, but never seen a mail notifying me about that). I've been looking for this all around MCC but can't find it anywhere.

 

Thanks.

 

-Murda

Link to comment
Share on other sites

As far as I know, when /etc/cron.daily runs it's job, the output gets sent to the root mailbox, which is then redirected to murda.

 

If it's not, check your /etc/crontab to make sure it's emailing to the correct place.

Link to comment
Share on other sites

I don´t think I understand what mail you´re talking about. You want the diff and secuity mail send not to your local mail folder but to an external mail box? Then just put in a normal email adress instead of your username. Or forward the mail in the local mail box to an external mail adress.

Link to comment
Share on other sites

As far as I know, when /etc/cron.daily runs it's job, the output gets sent to the root mailbox, which is then redirected to murda.

 

If it's not, check your /etc/crontab to make sure it's emailing to the correct place.

 

Ok, I'll do that. I tell you how it worked out in a few days.

Link to comment
Share on other sites

Ok, i have that update script in /etc/cron.daily/update.cron.

It has -rwxr-xr-x like everything else there.

 

Yesterday i used

urpmi --auto-select

to see if there's anything that needs updating. There was packages like tar and unzip. I didn't update them. I just put the auto update script to cron.

 

Today I used it again. It says "everything has been installed" (translation from finnish), but the report e-mail didn't tell me anything about it. Maybe tomorrow..

Link to comment
Share on other sites

Today I used it again. It says "everything has been installed" (translation from finnish), but the report e-mail didn't tell me anything about it. Maybe tomorrow..

 

Ok, today it gave me a Diff report to my mailbox. Not what I was looking for but it'll do.

Consider this one solved.

 

edit: some spelling mistakes.

 

-Murda

Edited by Murda
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...