LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices


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

Rep: Reputation: 30
execute root cron jobs


Hi

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 ?

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

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

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.
 
  


Reply


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

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian

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

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