Manage launchd agents for dotfiles auto-sync. Check status, start/stop services, view logs. Useful for monitoring and controlling automatic GitHub sync.
Manage launchd agents for automatic dotfiles synchronization to GitHub.
This skill helps you manage the auto-sync launchd agent that automatically syncs dotfiles changes to GitHub every hour.
**Key Components:**
Use this command to verify if the auto-sync agent is running:
```bash
launchctl list | grep dotfiles
```
If the agent is loaded, you'll see an entry with PID and status code.
To inspect the launchd agent configuration:
```bash
cat ~/Library/LaunchAgents/com.user.dotfiles-sync.plist
```
Validate plist syntax:
```bash
plutil -lint ~/Library/LaunchAgents/com.user.dotfiles-sync.plist
```
To review the sync script logic:
```bash
cat /Users/snkrheadz/ghq/github.com/snkrheadz/laptop/scripts/auto-sync.sh
```
Check recent sync activity:
```bash
tail -50 ~/Library/Logs/dotfiles-sync.log
```
For the most recent entries:
```bash
tail -20 ~/Library/Logs/dotfiles-sync.log
```
View full log:
```bash
cat ~/Library/Logs/dotfiles-sync.log
```
To stop the auto-sync agent:
```bash
launchctl unload ~/Library/LaunchAgents/com.user.dotfiles-sync.plist
```
To start or reload the auto-sync agent:
```bash
launchctl load ~/Library/LaunchAgents/com.user.dotfiles-sync.plist
```
To restart the agent (stop and start):
```bash
launchctl unload ~/Library/LaunchAgents/com.user.dotfiles-sync.plist && \
launchctl load ~/Library/LaunchAgents/com.user.dotfiles-sync.plist
```
To manually trigger a sync without waiting for the scheduled run:
```bash
/Users/snkrheadz/ghq/github.com/snkrheadz/laptop/scripts/auto-sync.sh
```
The `auto-sync.sh` script performs the following steps:
1. Change to dotfiles directory
2. Update Brewfile with `brew bundle dump --force`
3. Stage all changes with `git add -A`
4. Commit changes (only if there are modifications)
5. Push to remote repository
When issues occur, follow this sequence:
1. **Check agent status** - Verify if the agent is running
2. **Review logs** - Examine recent log entries for errors
3. **Test manual execution** - Run the sync script manually to isolate issues
4. **Restart agent** - If needed, restart the launchd agent
The launchd plist defines the agent configuration:
```xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "...">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.user.dotfiles-sync</string>
<key>ProgramArguments</key>
<array>
<string>/path/to/auto-sync.sh</string>
</array>
<key>StartInterval</key>
<integer>3600</integer>
<key>StandardOutPath</key>
<string>~/Library/Logs/dotfiles-sync.log</string>
<key>StandardErrorPath</key>
<string>~/Library/Logs/dotfiles-sync.log</string>
</dict>
</plist>
```
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/launchd-manage-64oxoj/raw