-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcom.user.daily-updates.plist.template
More file actions
82 lines (69 loc) · 2.81 KB
/
com.user.daily-updates.plist.template
File metadata and controls
82 lines (69 loc) · 2.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?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">
<!--
Daily Updates LaunchAgent - Automates system package updates
TEMPLATE FILE - Copy this to com.user.daily-updates.plist and replace placeholders
IMPORTANT: Before using this file, replace /ABSOLUTE/PATH/TO/HOME with your actual home directory path
Example: /Users/yourusername
LaunchAgents require absolute paths - tilde (~) and $HOME do NOT work in plist files!
To create your working version:
cp com.user.daily-updates.plist.template com.user.daily-updates.plist
sed -i '' "s|/ABSOLUTE/PATH/TO/HOME|$HOME|g" com.user.daily-updates.plist
SETUP:
1. Replace /ABSOLUTE/PATH/TO/HOME below with your full home directory path
2. cp ~/.dotfiles/com.user.daily-updates.plist ~/Library/LaunchAgents/
3. launchctl load ~/Library/LaunchAgents/com.user.daily-updates.plist
MANAGING:
Load (enable): launchctl load ~/Library/LaunchAgents/com.user.daily-updates.plist
Unload (disable): launchctl unload ~/Library/LaunchAgents/com.user.daily-updates.plist
Reload (refresh): launchctl unload ~/Library/LaunchAgents/com.user.daily-updates.plist && \
launchctl load ~/Library/LaunchAgents/com.user.daily-updates.plist
Check status: launchctl list | grep daily-updates
Run manually: launchctl start com.user.daily-updates
LOGS:
Standard output: tail -f /tmp/daily-updates.log
Error output: tail -f /tmp/daily-updates-error.log
CONFIGURATION:
- Currently runs twice daily at 10:00 AM and 6:00 PM
- Modify StartCalendarInterval to change schedule
- Remember to reload after making changes
-->
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.user.daily-updates</string>
<key>ProgramArguments</key>
<array>
<string>/bin/bash</string>
<string>-l</string>
<!-- TODO: Replace /ABSOLUTE/PATH/TO/HOME with your actual home directory (e.g., /Users/yourusername) -->
<string>/ABSOLUTE/PATH/TO/HOME/.dotfiles/bin/update</string>
</array>
<key>StartCalendarInterval</key>
<array>
<dict>
<key>Hour</key>
<integer>10</integer>
<key>Minute</key>
<integer>0</integer>
</dict>
<dict>
<key>Hour</key>
<integer>18</integer>
<key>Minute</key>
<integer>0</integer>
</dict>
</array>
<key>StandardOutPath</key>
<string>/tmp/daily-updates.log</string>
<key>StandardErrorPath</key>
<string>/tmp/daily-updates-error.log</string>
<key>RunAtLoad</key>
<false/>
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
</dict>
</dict>
</plist>