Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

DominikHoffmann

macrumors 6502a
Original poster
Jan 15, 2007
533
506
Indiana
In earlier versions of Mac OS X the crontab was at /etc/crontab. However, as far, as I can tell, no longer. Where did it move to?
 

MacUser2525

Suspended
Mar 17, 2007
2,097
377
Canada
In earlier versions of Mac OS X the crontab was at /etc/crontab. However, as far, as I can tell, no longer. Where did it move to?

Looks like /usr/bin is the spot it now resides.

Code:
$  locate crontab |grep bin
/Volumes/Mavericks_Clone/usr/bin/crontab
/Volumes/Mavericks_GM/usr/bin/crontab
/usr/bin/crontab
 

DominikHoffmann

macrumors 6502a
Original poster
Jan 15, 2007
533
506
Indiana
I found a reference to
Code:
/usr/lib/cron/
That is actually a symlink to
Code:
/var/at/
where I found my crontab at
Code:
/var/at/tabs/username
I know that you’re not supposed to edit the file directly. However, if you want to restore a crontab from backup, you have to know, where to find it. In my research I have come across references to Mountain Lion deleting
Code:
/etc/crontab
although it wasn't clear, whether this happens on every reboot or whether it does only when Mountain Lion is installed on top of an earlier version of the OS.
 

Tonsko

macrumors 6502
Aug 19, 2010
293
1
Are you just trying to schedule stuff?

At risk of teaching you to suck eggs, ML doesn't use that to schedule tasks any more; it uses launchctl and plist files.

Apologies if that's not what you're after.
 

DominikHoffmann

macrumors 6502a
Original poster
Jan 15, 2007
533
506
Indiana
Apple urges people to switch from using cron to using launchd with Mountain Lion. However, cron was alive and well with ML—I ran several scripts to run nightly for cleaning up my Downloads folder and such.

I haven’t yet ascertained, whether this is still true with Mavericks, but even there, crontab is installed in /usr/bin/. Also,
Code:
crontab -e
works, and so do the other crontab options. Whether it actually runs as scheduled I will learn tonight.

Cron is so much easier to program than launchd. That’s the real reason.
 

Tonsko

macrumors 6502
Aug 19, 2010
293
1
Heh, oops! I believed the hype when I wanted to schedule something. So I wrestled with launchd. Got it working, but it wasn't straightforward... :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.