Schedule Mac Script to Run Unattended

by GRAPHISOFT and Ed Brown · updated: 11.09.2010

On the Mac the two standard methods for scheduling programs to run unattended are installed with the operating system. The first option is to edit the /etc/crontab. The second option is to run the crontab utility. In both cases you need to be knowledgeable with a text editor that can be launched from the terminal window ( pico or vi will work, but the commonly used that can be launched from the Applications folder will not work). The difference between the two methods is subtle and most often irrelevant. To schedule a backup of the bim you will probably want to edit the system wide crontab which is the “/etc/crontab” file. The particularly annoying difference between the two methods is that the /etc/crontab has 8 fields where as the crontab that is edited with the crontab utility has only 7 fields. If you miss a field the program you want to schedule probably will not run at the time you desire.

I recommend an easier approach then fiddling with the out of the box options. Download a free utility called CronniX that will help you schedule your program more intuitively and visually. I last downloaded it from

To get familiar with Cronnix I suggest you create a simple program call bogus.bash with TextEdit. Here is the program:

 #! /bin/bash
 date >/Users/[your user name]/crud.txt

Save this program and then open a Terminal window. At the prompt type:

 chmod +x bogus.bash

The first line makes your program executable. The second command executes it. At this point you should have a file in your user folder called “crud.txt”. If you open it with TextEdit you will see it has the date and time you executed it. If you run at the terminal prompt:


again, then you will see that “crud.txt” changed to a newer date. Now you are ready to start CronniX and schedule bogus.bash.

When you first start CronniX you will need to create a “New” entry. Click on “New” and schedule to run bogus.bash for a few minutes later than the time you are adding this entry. It should look something similar to this.


After you save it, it will look like this.


Now wait until a time after which it should have run. Check the “crud.txt” file to make sure that indeed the time changed. If the time is not the time you scheduled it for in CronniX you need to look for the problem. (Maybe you didn’t specify every day, or it is 8:00 at night and you specified 8 for the hour instead of 20. It is a 24 hour clock!)

Once you are sure it is working as desired, add the backup.


  • Was this Helpful ?
  • 2   ​1

Related content

Backup script for the Mac

Some programming experience required! Outline of backup Test that directories are correctly specified. Prepare an area on the local disk for the backup Make the master module backup Backup non-master module project data into a folder numbered for the…