Ubuntu Forums ubuntu.com - launchpad.net - ubuntu help  

Go Back   Ubuntu Forums > The Ubuntu Forum Community > Other Community Discussions > Tutorials & Tips
Register Reset Password Forum Help Forum Council Search Today's Posts Mark Forums Read

Tutorials & Tips
The place to find Ubuntu related Tips & Tricks.

 
Thread Tools Display Modes
Old October 29th, 2004   #1
cacofonix
A Carafe of Ubuntu
 
cacofonix's Avatar
 
Join Date: Oct 2004
Location: Australia
Beans: 90
HOWTO: Using Cron to Update System

Here is a quick and hopefully informative way to use cron to update your system.

Cron is a scheduling program used often in many *nix distro to run automated tasks if your like me and are coming from windows it would equate to task scheduler in windows.

cron's format is
minute: hour: day of the month: day of the week: command:


30 22 * * 0 apt-get update && apt-get -y dist-upgrade -t warty-security

The above example would tell cron to run a check for security updates every sunday at 10:30 pm

*suggested by jdong*

30 22 * * 0 apt-get update

This job would tell cron to update but you would be required to upgrade manually

To make a cron job yourself type in an open console type:
1) crontab -e
2) press the i key to insert commands
3) input your commands using the above guide
4) press esc and then press :wq! to exit and save changes

hopefully if all goes well you should now have setup cron to run a specific task at its appointed time

if your not comfortable inputing the commands yourself there is a site that goes into more detail and has a tool to set up your commands for you.

http://www.clockwatchers.com/cron_tool.html

I hope this helps

Cacofonix

* updated to include sugestions by jdong

Last edited by cacofonix; November 25th, 2004 at 12:56 AM..
cacofonix is offline   Reply With Quote
Old October 29th, 2004   #2
jayclark
Just Give Me the Beans!
 
jayclark's Avatar
 
Join Date: Oct 2004
Location: Virginia, USA
Beans: 42
Ubuntu Breezy 5.10
Re: How To use cron to update ubuntu

Although I won't use it because I perfer to do it myself. I even did it myself when running windows. This is a very good guide.
__________________
Don't confuse stupidity with bravery.

One who relies on sight may not see at all.
jayclark is offline   Reply With Quote
Old October 30th, 2004   #3
jdong
Ultimate Coffee Grinder
 
jdong's Avatar
 
Join Date: Oct 2004
Location: Cambridge. MA
Beans: 5,063
Ubuntu 8.10 Intrepid Ibex
Re: How To use cron to update ubuntu

I don't think it's correct. apt-get dist-upgrade will just sit at a Y/n prompt indefinitely. Every night you run it, you'll get a new one...... You need apt-get -y dist-upgrade -t warty-security.


If you don't like for updates to apply without you knowing, you can always just set a cron job for apt-get update so you'll always have up to date sources.
jdong is offline   Reply With Quote
Old January 11th, 2006   #4
rapha
A Carafe of Ubuntu
 
rapha's Avatar
 
Join Date: Nov 2004
Location: Stuttgart, Germany
Beans: 86
Ubuntu 9.10 Karmic Koala
Send a message via ICQ to rapha Send a message via Skype™ to rapha
Re: HOWTO: Using Cron to Update System

Although apt-get does have the '-y' option, many other commands do not. In that case, you can simply say:
Code:
yes 'y' | your -command -here
and it will answer all questions with 'y'.
__________________
NIETS IS ONMOGELIJK!
rapha is offline   Reply With Quote
Old October 10th, 2006   #5
jsandys
5 Cups of Ubuntu
 
jsandys's Avatar
 
Join Date: Oct 2006
Location: Shoreline, Washington
Beans: 40
Ubuntu 6.06 Dapper
Re: HOWTO: Using Cron to Update System

How can I extend this to dial up, say every Saturday night at midnight, do the update, then hangup?

I found the answer at this thread:
http://ubuntuforums.org/showthread.php?t=207422

This thread has an elaborate script:
http://ubuntuforums.org/showthread.php?t=197300

Last edited by jsandys; October 13th, 2006 at 06:17 PM..
jsandys is offline   Reply With Quote

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 12:12 AM.


vBulletin ©2000 - 2009, Jelsoft Enterprises Ltd. Ubuntu Logo, Ubuntu and Canonical © Canonical Ltd. Tango Icons © Tango Desktop Project. lingonberry