Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save patent-ed/53715a971e554775d97f081a59e4dbc7 to your computer and use it in GitHub Desktop.
Save patent-ed/53715a971e554775d97f081a59e4dbc7 to your computer and use it in GitHub Desktop.
plist file for launchd - To set up the existing script (remove_old_plex_files.sh) to run once every day and empty the trash, you can use launchd. Here are the steps to create a launchd plist file and configure it to run the script daily:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//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.remove_old_plex_files</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/remove_old_plex_files.sh</string>
</array>
<key>StartCalendarInterval</key>
<dict>
<key>Hour</key>
<integer>1</integer>
<key>Minute</key>
<integer>0</integer>
</dict>
<key>StandardErrorPath</key>
<string>/tmp/com.user.remove_old_plex_files.err</string>
<key>StandardOutPath</key>
<string>/tmp/com.user.remove_old_plex_files.out</string>
</dict>
</plist>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment