I want to edit my crontab file to schedule a script. Where do I find it?
4 Answers
In Mac OS X Lion the user crontabs are stored in /var/at/tabs. In the past they were located in /var/cron/tabs.
You should use crontab -e to interact with these in general, but knowing the location is useful for when you want to restore them from a backup of your disk, or something similar.
Updated 2022-01:
/varis a link to/private/var/./usr/lib/cronis a link to/var/at.
The real primary directory is /private/var/at with the crontab files being stored in /private/var/at/tabs
- 739
If you don't want to use launchd, you can edit your crontab as you would do on any unix systems :
crontab -e
Or, you can use a GUI software like CronniX.
- 8,779
- 5
- 38
- 38
-
3
-
1I would highly recommend CronniX. It provides a much (much!) easier way of setting up cronjobs. – daviesgeek Nov 10 '11 at 07:52
-
-
@Lloyd I would note the OP thinks that this HAS answered the question so they have explicitly said that this DOES answer the question – mmmmmm Apr 03 '22 at 09:34
It should be noted that if you aren't accustomed to using vim (the default crontab editor) then you can specify your editor as follows:
VISUAL=nano crontab -e
- 100,768
- 621
The OS X way is to use launchctl to run jobs at a time.
For ease of use there are GUIs called Launch Control and Lingon.
-
-
1@Lloyd - The question is how to schedule a script . crontab is just how you do that on many Unixes but on macOS you use launchctl – mmmmmm Apr 03 '22 at 09:32
-
read your answer again and ask whether it answers "Where is my crontab file?".. that's the original question and my question too. – Lloyd Apr 03 '22 at 10:38
-
The answer is you don't do that on macOS you use another method. The end result is scheduling a script and that is what matter Using crontab is using the wrong tool so it is better to suggest the better way. I read the question as "I want to .... to schedule a script." Look at the required end result not the method to do it which happens to be not the best for macOS. – mmmmmm Apr 03 '22 at 10:42
/private/var/at/tabs/. I usedfind / -iname *cron*. – AlexMA Aug 26 '16 at 15:04/usr/lib/cron/tabs. Although, you need root permission to view the contents of that folder. – GDP2 Dec 30 '21 at 20:42# DO NOT EDIT THIS FILE - edit the master and reinstall– geotheory May 03 '22 at 13:54