Jump to content

System Updates Startup-Script [solved]


Recommended Posts

I had an idea (don't worry, didn't hurt that much :P ), about a script to run at startup to something along the lines of the following:

 

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

 

I realise I could log into the system and then just run this manually, is there any way I could get it to run once the system is up-and-running, but without login. And if so, where would be by best place to stash it?

 

What I'm intending to do is just get the system up-to-date with security updates, etc. So maybe the --auto-select --auto isn't the correct parameter I would be wanting to use. Although this would ensure that completely everything is up-to-date.

 

Idea's very much appreciated.

Link to comment
Share on other sites

Nice one! Does it matter what I name the file and where I store it? I found a /etc/cron.daily directory, would this be the place for it?

 

Is it just a case of storing in the directory, and then the job get's run?

Link to comment
Share on other sites

One more thing, which log file would I need to check to see that the update and or job/run was successful.

 

Dude normally, when a cron job is completed, the error message (if available) and the output of the cron job is mailed to the root.

 

You can check it out by viewing /etc/crontab

there'll be something listed like

SHELL=/bin/bash

PATH=/sbin:/bin:/usr/sbin:/usr/bin

MAILTO=root

HOME=/

 

Further log files can be found at /var/log/cron and /var/log/messages

:cheesy:

Link to comment
Share on other sites

Dude normally, when a cron job is completed, the error message (if available) and the output of the cron job is mailed to the root.

 

You can check it out by viewing /etc/crontab

there'll be something listed like

SHELL=/bin/bash

PATH=/sbin:/bin:/usr/sbin:/usr/bin

MAILTO=root

HOME=/

 

 

i'd like to add, make sure postfix runs on your system and alias root to your regular email account in order for you to recieve that email on that regular email acct of yours... or you can directly replace the part..

ex..

MAILTO=ian74@yourmail.com

Link to comment
Share on other sites

Cool, I got postfix configured and running too, so that should all be OK.

 

If the alias isn't pointed to my account, I presume it will just stay in the root mailbox anyhow? This is OK, since I can check it through webmin.

Link to comment
Share on other sites

Actually, I decided to change it :P

 

I went into webmin, then postfix and mail aliases, and changed root from pointing to postfix, to pointing to my user id instead.

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...