<span class="gmail_quote">On 8/18/07, <b class="gmail_sendername">Ian Pascoe</b> <<a href="mailto:softy.lofty.ilp@btinternet.com">softy.lofty.ilp@btinternet.com</a>> wrote:</span><br><div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
How can I set up a kron job or similar that will automatically update the<br>machine without the necessity of her either using Update Manager or the<br>terminal?<br><br>Ideally so that it runs weekly.</blockquote><div><br>
This should be as simple as adding a weekly cron that runs "apt-get upgrade".<br>
<br>
Being a laptop, it would probably be best to use anacron to do this.
The standard cron will skip jobs if they occurred when the machine was
not switched on. anacron would instead run the command as soon as the
system starts back up.<br>
<br>
As I understand, Ubuntu already uses anacron by default, so no work needs to be done here (someone correct me if I'm wrong).<br>
<br>
sudo nano /etc/cron.weekly/system_update<br>
<br>
Add this text:<br>
#!/bin/sh<br>
#<br>
# Update the system<br>/usr/bin/apt-get -q -y upgrade<br>
<br>
Then press Ctrl+O to save the file, then Ctrl+X to exit<br>
<br>The -q makes apt-get strip unnecessary output, and -y will answer "yes" to any questions it would usually ask.<br>Also, an apt-get update would necessary to download the index of packages (which tells Ubuntu the current versions), but I believe this is already done automatically in Ubuntu, just after start-up.
<br><br>Then:<br>
sudo chmod 755 /etc/cron.weekly/system_update<br>
<br>
Hope this helps,<br>
<br>
Matthew.<br></div></div>