Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

MacOS comes with daily/weekly/monthly system tasks. However it looks like I have to manually start those tasks. Is there a way to automatically have those tasks executed daily/weekly/monthly?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

They are named like this because they are already executed daily, weekly and monthly. MainMenu just lets you execute them manually.

Open Terminal and enter the following:

ls -al /var/log/*.out

The dates listed next to these log file names are when the respective maintenance task was last executed:

-rw-r--r--  1 root  wheel  496994  5 Mar 03:15 /var/log/daily.out
-rw-r--r--  1 root  wheel    2088  1 Mar 06:02 /var/log/monthly.out
-rw-r--r--  1 root  wheel    5289  5 Mar 03:15 /var/log/weekly.out

Run them manually using the periodic command. You need root permissions to do so, and need to supply which you want to execute. To run all of them:

sudo periodic daily weekly monthly

You can use AppleScript Editor to make a Script or Application that executes e.g. the weekly task by entering this:

do shell script "periodic weekly" with administrator privileges

Using Automator, you can make it into a service.


To change when these tasks are regularly scheduled, edit their preference files:

/System/Library/LaunchDaemons/com.apple.periodic-daily.plist
/System/Library/LaunchDaemons/com.apple.periodic-weekly.plist
/System/Library/LaunchDaemons/com.apple.periodic-monthly.plist

You can use Property List Editor included with Apple's Developer Tools, or a simple text editor. Look for <key>StartCalendarInterval</key>. When they're running is pretty self-explanatory:

Daily runs at 3:15 AM if it can:

<dict>
    <key>Hour</key>
    <integer>3</integer>
    <key>Minute</key>
    <integer>15</integer>
</dict>

Once a week runs Saturday:

<dict>
    <key>Hour</key>
    <integer>3</integer>
    <key>Minute</key>
    <integer>15</integer>
    <key>Weekday</key>
    <integer>6</integer>
</dict>

Once a month on the first day of the month:

<dict>
    <key>Hour</key>
    <integer>5</integer>
    <key>Minute</key>
    <integer>30</integer>
    <key>Day</key>
    <integer>1</integer>
</dict>

This website explains what happens when these scripts are run.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.