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

Notices



Reply
 
Search this Thread
Old 06-23-2007, 12:34 AM   #1
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 12.04 - Server 12.04.4 LTS
Posts: 935

Rep: Reputation: 32
crontab


Hi all

I'm trying to access crontab, but i get the following message

Code:
crontab -l 
no crontab for root
any one know whats that about

care to explain please

I was going to add some crontabs to back up my site and run the system updates.

Code:
5 3 * * * /usr/bin/apt-get update
is it ok to edit the file it self ? vim /etc/crontab, or should i use the crontab -e command

here is what my cron says now before editing

Code:
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab'
# command to install the new version when you edit this file.
# This file also has a username field, that none of the other crontabs do.

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

# m h dom mon dow user  command
17 *    * * *   root    run-parts --report /etc/cron.hourly
25 6    * * *   root    test -x /usr/sbin/anacron || run-parts --report /etc/cron.daily
47 6    * * 7   root    test -x /usr/sbin/anacron || run-parts --report /etc/cron.weekly
52 6    1 * *   root    test -x /usr/sbin/anacron || run-parts --report /etc/cron.monthly
#
TT

Last edited by tommytomato; 06-23-2007 at 12:49 AM.
 
Old 06-23-2007, 02:04 AM   #2
avallach
Member
 
Registered: Sep 2006
Location: Silesia
Distribution: Debian GNU/Linux 4.0, ArchLinux, OpenBSD
Posts: 190
Blog Entries: 2

Rep: Reputation: 30
You should use
Code:
crontab -e
. When you run this command it will open an editor, which is set by EDITOR environment variable, and you can edit crontab files in a "clean" way.
 
Old 06-23-2007, 02:07 AM   #3
tommytomato
Member
 
Registered: Nov 2003
Location: Narrogin Western Australia
Distribution: GUI Ubuntu 12.04 - Server 12.04.4 LTS
Posts: 935

Original Poster
Rep: Reputation: 32
When running the crontab -e command will that make the changes to /etc/crontab as root

or do you have to run a admin user and then run crontab

TT
 
Old 06-23-2007, 06:21 AM   #4
avallach
Member
 
Registered: Sep 2006
Location: Silesia
Distribution: Debian GNU/Linux 4.0, ArchLinux, OpenBSD
Posts: 190
Blog Entries: 2

Rep: Reputation: 30
In crontab every user has it's own jobs when you run crontab -e it will edit root's planned jobs, when you run crontab -e as someone it will edit someone's planned jobs..
 
Old 07-03-2007, 04:15 PM   #5
archtoad6
Senior Member
 
Registered: Oct 2004
Location: Houston, TX (usa)
Distribution: MEPIS, Debian, Knoppix,
Posts: 4,727
Blog Entries: 15

Rep: Reputation: 231Reputation: 231Reputation: 231
In addition, there is system crontab /etc/crontab, which is independent of the user crontabs. See the crontab 5 man page.
 
  


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
crontab Timur Sakayev Linux - General 1 03-20-2006 02:20 PM
about crontab shipon_97 Linux - General 1 02-28-2006 06:22 AM
using crontab goodolday Linux - Newbie 1 04-26-2005 08:16 PM
system-wide crontab in /etc/crontab ner Linux - General 2 11-18-2003 01:35 PM
Crontab WiWa Linux - Software 1 10-06-2003 06:20 PM


All times are GMT -5. The time now is 04:45 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration