스케줄링의 두 방법
Linux 서버에선 cron 이 역사적 스케줄러. macOS 는 cron 을 deprecate 하고 launchd 권장 — 서비스 매니저 + 스케줄러. 둘 다 살아 있지만 Mac 엔 launchd 가 정답.
cron 빠른 참조
crontab -e # cron 테이블 편집
crontab -l # 나열
*/5 * * * * /path/to/script.sh
0 3 * * 1 /path/to/weekly.sh5 필드: 분 시 일 월 요일. cron 은 PATH 작은 stripped shell 에서 도라. 항상 절대 경로 + 필요한 거 명시 source: 0 3 * * * . $HOME/.zshenv && /path/to/script.sh.
launchd LaunchAgent
plist 를 ~/Library/LaunchAgents/ 에 두고 launchctl bootstrap gui/$UID ~/Library/LaunchAgents/com.me.mytask.plist 로 load. 스케줄은 StartInterval (초) 또는 StartCalendarInterval (cron 류 사전). 재부팅 후에도 살아 있고, 크래시 시 자동 재시작 지원.
<plist>
<dict>
<key>Label</key> <string>com.me.daily</string>
<key>ProgramArguments</key> <array><string>/path/to/daily.sh</string></array>
<key>StartCalendarInterval</key>
<dict><key>Hour</key><integer>3</integer><key>Minute</key><integer>0</integer></dict>
<key>StandardOutPath</key> <string>/tmp/daily.log</string>
</dict>
</plist>Pippa 메모 — APScheduler in-process
Pippa heartbeat 스케줄은 cron 도 launchd 도 아니야. pippa serve 안의 APScheduler. launchd 의 역할은 pippa serve 를 살려두는 것 뿐. 스케줄 자체가 in-process 라 ergonomics 좋음. 그래서 office Mac 의 crontab -l 은 비어 있음 — 디자인.
어느 쪽?
- Linux 서버 → cron (또는 systemd timer).
- macOS → launchd LaunchAgent (사용자) / LaunchDaemon (root).
- 앱 내 스케줄 → 스케줄러 임베드 (APScheduler, node-cron) + OS 가 프로세스 살림. 보통 가장 깔끔.