Manage launchd auto-sync agent for dotfiles synchronization. Check status, start/stop service, view logs, and troubleshoot the automated GitHub sync process.
Manage the launchd auto-sync agent for automated dotfiles synchronization to GitHub. This skill provides comprehensive management of the hourly sync service including status checks, service control, log inspection, and troubleshooting.
The auto-sync agent automatically synchronizes dotfiles changes to GitHub every hour using macOS launchd.
**Key Components:**
When the user requests launchd or auto-sync management, follow these steps:
Start with a comprehensive status check:
```bash
launchctl list | grep dotfiles
```
Then check for recent log activity:
```bash
tail -20 ~/Library/Logs/dotfiles-sync.log
```
Report to the user whether the agent is running and the status of recent sync operations.
If the user wants to inspect configuration:
**View plist file:**
```bash
cat ~/Library/LaunchAgents/com.user.dotfiles-sync.plist
```
**View sync script:**
```bash
cat /Users/snkrheadz/ghq/github.com/snkrheadz/laptop/scripts/auto-sync.sh
```
**Validate plist syntax:**
```bash
plutil -lint ~/Library/LaunchAgents/com.user.dotfiles-sync.plist
```
**Last 50 entries:**
```bash
tail -50 ~/Library/Logs/dotfiles-sync.log
```
**Full log file:**
```bash
cat ~/Library/Logs/dotfiles-sync.log
```
**Stop the agent:**
```bash
launchctl unload ~/Library/LaunchAgents/com.user.dotfiles-sync.plist
```
**Start the agent:**
```bash
launchctl load ~/Library/LaunchAgents/com.user.dotfiles-sync.plist
```
**Restart the agent:**
```bash
launchctl unload ~/Library/LaunchAgents/com.user.dotfiles-sync.plist && \
launchctl load ~/Library/LaunchAgents/com.user.dotfiles-sync.plist
```
If the user needs immediate synchronization:
```bash
/Users/snkrheadz/ghq/github.com/snkrheadz/laptop/scripts/auto-sync.sh
```
When issues occur, follow this diagnostic sequence:
1. Check agent status with `launchctl list | grep dotfiles`
2. Review recent logs with `tail -50 ~/Library/Logs/dotfiles-sync.log`
3. Test manual execution of the sync script
4. Verify network connectivity if push failures occur
5. Restart the agent if needed
The synchronization script performs these operations:
1. Navigate to dotfiles directory
2. Execute `brew bundle dump --force` to update Brewfile
3. Stage all changes with `git add -A`
4. Commit changes only if modifications exist
5. Push to remote repository
```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-czjs8m/raw