image
image

Go Back   macosx.com > Mac Help Forums > Unix & X11

Reply
 
LinkBack Thread Tools
  #1  
Old November 28th, 2005, 11:58 PM
dmetzcher's Avatar
Metzcher.com
 
Join Date: Apr 2005
Location: New Jersey, USA
Posts: 558
Thanks: 0
Thanked 0 Times in 0 Posts
dmetzcher is on a distinguished road
Where is the user crontab file located?

Can someone please tell me the path of the user crontab?

My apologies is this has already been answered. I did a search and couldn't find anything.

Thanks.
__________________
Dennis R. Metzcher
Metzcher.com
Reply With Quote
  #2  
Old November 29th, 2005, 01:47 AM
Registered User
 
Join Date: Nov 2005
Posts: 111
Thanks: 1
Thanked 0 Times in 0 Posts
mosx86 is on a distinguished road
Quote:
Originally Posted by dmetzcher
Can someone please tell me the path of the user crontab?

My apologies is this has already been answered. I did a search and couldn't find anything.

Thanks.
They should be in /var/cron/tabs

You don't typically edit them manually though. I would suggest you read the man page.
Reply With Quote
  #3  
Old November 29th, 2005, 10:02 AM
Registered User
 
Join Date: May 2005
Posts: 1,339
Thanks: 0
Thanked 5 Times in 5 Posts
barhar is on a distinguished road
'... please tell me the path of the user crontab', '/private/etc/' [ok, this is the 'root' level crontab - 29 Nov. 2005, 17.05].

A suggestion:
Make a copy (and rename it, such as 'crontab_') before editing the original 'crontab' file.

If you do edit the 'crontab' file, as any (log'ed in) user but 'root', remember to change the owner to 'root' ('system' via file's 'Get Info' window) and group to 'wheel'.

Last edited by barhar; November 29th, 2005 at 05:05 PM.
Reply With Quote
  #4  
Old November 29th, 2005, 11:57 AM
dmetzcher's Avatar
Metzcher.com
 
Join Date: Apr 2005
Location: New Jersey, USA
Posts: 558
Thanks: 0
Thanked 0 Times in 0 Posts
dmetzcher is on a distinguished road
Thanks to both of you! I found it. I found a crontab in '/var/cron/tabs/' named after my user name.

Just so I am perfectly clear, if I edit this crontab using the following command in the Terminal:
$ sudo pico /var/cron/tabs/[crontab-name]
...I won't have to change the owner to root and the group to wheel in the Finder. Correct?

Honestly, I use CronniX to edit my crontab files, but I wanted to know how to do it from the Terminal, so this is more of a learning excercise.

Thanks again!
__________________
Dennis R. Metzcher
Metzcher.com
Reply With Quote
  #5  
Old November 29th, 2005, 01:18 PM
BjarneDM's Avatar
Registered User
 
Join Date: Oct 2005
Location: København ; Danmark ; Europa
Posts: 148
Thanks: 0
Thanked 0 Times in 0 Posts
BjarneDM is on a distinguished road
1) the systemwide crontab file in /etc/crontab is edited normally with eg 'sudo pico /etc/crontab'
2) the user specific crontab files are editied using the 'crontab' command. See 'man crontab' on how to use it.
__________________
Bjarne D Mathiesen
København ; Danmark ; Europa
Reply With Quote
  #6  
Old November 29th, 2005, 01:18 PM
applemaz's Avatar
Registered User
 
Join Date: Aug 2005
Posts: 155
Thanks: 0
Thanked 1 Time in 1 Post
applemaz is on a distinguished road
For the cron under your personal account, you can simply say:
$ crontab -e --> This will bring you into edit mode. You don't need to know the files location.

To erase the cron file, just type --> $ crontab -r

To list the current cron contents type --> $ crontab -l

You can use Pico, emacs or vi to create a new cron file with times and files to execute and then type --> $ cron filename

I don't think you want to fool around with the root users cron file. Each user (if enabled) can have their own cron file and they won't clobber other users (or the root users) cron.
Reply With Quote
  #7  
Old November 29th, 2005, 01:49 PM
dmetzcher's Avatar
Metzcher.com
 
Join Date: Apr 2005
Location: New Jersey, USA
Posts: 558
Thanks: 0
Thanked 0 Times in 0 Posts
dmetzcher is on a distinguished road
Quote:
Originally Posted by BjarneDM
1) the systemwide crontab file in /etc/crontab is edited normally with eg 'sudo pico /etc/crontab'
2) the user specific crontab files are editied using the 'crontab' command. See 'man crontab' on how to use it.
Thanks. I found that 'crontab -e' does this for me, but I was wondering more about being to edit another user's crontab, which this command will not let me do. For my own crontab, it's certainly easier though.
__________________
Dennis R. Metzcher
Metzcher.com
Reply With Quote
  #8  
Old November 29th, 2005, 07:35 PM
BjarneDM's Avatar
Registered User
 
Join Date: Oct 2005
Location: København ; Danmark ; Europa
Posts: 148
Thanks: 0
Thanked 0 Times in 0 Posts
BjarneDM is on a distinguished road
Read the 'man 1 crontab' again for an answer to your problem
And the 'man 5 crontab' will provide further information on the format of the entries in the crontab files.
__________________
Bjarne D Mathiesen
København ; Danmark ; Europa
Reply With Quote
Reply

Bookmarks

Thread Tools

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump


All times are GMT -5. The time now is 05:08 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0 RC1
Copyright 2000-2010 DigitalCrowd, Inc.