image
image

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

Reply
 
Thread Tools
  #1  
Old November 28th, 2005, 10:58 PM
MyMacBlog.com
 
Join Date: Apr 2005
Location: New Jersey, USA
Posts: 536
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
MyMacBlog.com: My experiences with the Mac OS, a switcher's point of view. With a new Mac tip each week day.
Reply With Quote
  #2  
Old November 29th, 2005, 12:47 AM
Registered User
 
Join Date: Nov 2005
Posts: 104
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, 09:02 AM
Registered User
 
Join Date: May 2005
Posts: 1,338
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 04:05 PM.
Reply With Quote
  #4  
Old November 29th, 2005, 10:57 AM
MyMacBlog.com
 
Join Date: Apr 2005
Location: New Jersey, USA
Posts: 536
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
MyMacBlog.com: My experiences with the Mac OS, a switcher's point of view. With a new Mac tip each week day.
Reply With Quote
  #5  
Old November 29th, 2005, 12:18 PM
BjarneDM's Avatar
Registered User
 
Join Date: Oct 2005
Location: København ; Danmark ; Europa
Posts: 148
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, 12:18 PM
applemaz's Avatar
Registered User
 
Join Date: Aug 2005
Posts: 142
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, 12:49 PM
MyMacBlog.com
 
Join Date: Apr 2005
Location: New Jersey, USA
Posts: 536
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
MyMacBlog.com: My experiences with the Mac OS, a switcher's point of view. With a new Mac tip each week day.
Reply With Quote
  #8  
Old November 29th, 2005, 06:35 PM
BjarneDM's Avatar
Registered User
 
Join Date: Oct 2005
Location: København ; Danmark ; Europa
Posts: 148
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

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

vB 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 09:39 AM.


Mac Support® Version 3.7.0 Beta 5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0
Copyright 2000-2008 DigitalCrowd, Inc.