LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   execute root cron jobs (https://www.linuxquestions.org/questions/debian-26/execute-root-cron-jobs-582965/)

props666999 09-07-2007 11:46 AM

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

AlucardZero 09-07-2007 12:40 PM

Quote:

Originally Posted by props666999 (Post 2884620)
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.


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