From 9b7482b9f67c0e5d2638d928b368e2b1b537a765 Mon Sep 17 00:00:00 2001 From: pfych Date: Sat, 17 Aug 2024 08:57:26 +1000 Subject: [PATCH] Added README for cron --- .config/scripts/cron/README.md | 47 ++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 .config/scripts/cron/README.md diff --git a/.config/scripts/cron/README.md b/.config/scripts/cron/README.md new file mode 100644 index 0000000..1773335 --- /dev/null +++ b/.config/scripts/cron/README.md @@ -0,0 +1,47 @@ +# `launchd` & `cron` + +Currently all these scheduled jobs run on an up-to-date MacOS system. This means that `launchd` is the preffered method of scheduling jobs. + +Sadly, `launchd` plist files exist at `~/Library/LaunchAgents/` which means if I sync these to this repository, they will polute standard linux home folders. (By default MacOS hides `~/Library`) + +Eventually - I do plan on migrating my primary server to a linux-based system. But that costs money and the Mac it's currently running on was free. + +## Backup launchd configuaration + +```sh +launchctl remove launchd.restic # If it's already running +launchctl load -w ~/Library/LaunchAgents/launchd.restic.plist +launchctl list | grep restic +``` + +```plist + + + + + Label + launchd.restic + ProgramArguments + + /bin/zsh + -c + source /Users/noahheague/.zshrc ; /Users/noahheague/.config/scripts/cron/backup-server.sh + + StandardErrorPath + /Users/noahheague/restic-err.txt + StandardOutPath + /Users/noahheague/restic-out.txt + StartCalendarInterval + + + Hour + 0 + Minute + 0 + + + UserName + noahheague + + +```