Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Debian This forum is for the discussion of Debian Linux.


  Search this Thread
Old 09-07-2007, 11:46 AM   #1
Registered: Oct 2003
Location: Greece
Posts: 260

Rep: Reputation: 30
execute root cron jobs


i want to set up a cron job for updating Debian etch

in /etc/cron.hourly

i have created the update file and made it executable. In it i have entered
apt-get update && apt-get upgrade

now as normal user typed crontab -e
and entered 0 * * * * ./etc/cron.hourly/update

every hour to run the update script

now this doesn't work and i believe at a single glance you know why it doesn't work. Is it because the apt-get command is executed only by the root and im a normal user or it is something else ?

Old 09-07-2007, 12:40 PM   #2
Senior Member
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 613Reputation: 613Reputation: 613Reputation: 613Reputation: 613Reputation: 613
Originally Posted by props666999 View Post
Is it because the apt-get command is executed only by the root and im a normal user

Either put that in root's crontab with sudo crontab -e -u root, or put a small script in /etc/cron.hourly, following the example of files there, or install the cron-apt package which will do this for you.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
shell script using /etc/cron.hourly to execute cron.php file? rioguia Programming 3 06-11-2008 08:09 AM
cron jobs bilal_linux Linux - Software 10 04-25-2007 07:49 AM
cron jobs dont execute.. :( logicalfuzz Linux - Software 1 02-24-2006 05:43 AM
Can't run cron jobs as user, only root Kropotkin Linux - Newbie 5 11-10-2004 09:30 AM
CRON Jobs scottpioso Linux - Software 63 11-28-2003 06:45 PM > Forums > Linux Forums > Linux - Distributions > Debian

All times are GMT -5. The time now is 04:05 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration