0

I'm trying to get my mac to run the purge command every hour by having the following com.user.purge.plist list in /Library/LaunchDaemons:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>com.user.purge</string>
    <key>OnDemand</key>
    <true/>
    <key>ProgramArguments</key>
    <array>
        <string>purge</string>
    </array>
    <key>StartInterval</key>
    <integer>3600</integer>
</dict>
</plist>

Yet it doesn't seem to run it. Any idea why?

PS. I have given my user nopassword privilege in sudoers as well.

1
  • 2
    This question appears to be off-topic because it is belongs on Ask Different
    – user1864610
    May 8, 2014 at 4:51

1 Answer 1

2

A couple things could be going wrong here.

1) you need to properly set permissions on your launchdaemon files.

Apple's TN2083 (Technote) states:

When you install your daemon, make sure that you set the file system permissions correctly. Apple recommends that daemons be owned by root, have an owning group of wheel, and use permissions 755 (rwxr-xr-x) for executables and directories, and 644 (rw-r--r--) for files.

2) have you tried loading your daemon via "launchctl" yet?

try this:

launchctl load /Library/LaunchDaemons/com.user.purge.plist
launchctl start /Library/LaunchDaemons/com.user.purge.plist
launchctl list

and see if it appears there

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