From 10b386ac92a757186f05a167957c43aabe0d3918 Mon Sep 17 00:00:00 2001 From: Ronan Connolly Date: Thu, 9 Feb 2017 13:41:47 +0000 Subject: [PATCH] Update OSX Launchd Readme section Tweaked the readme section for the OSX Launchd Readme section. --- README.md | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 4e6f0fd..46ea08f 100644 --- a/README.md +++ b/README.md @@ -76,9 +76,18 @@ endif ### Using Launchd (OSX) launchd is recommended over cron for the OSX system. -This runs on load and from then on every 24 hours (86400 seconds). +This runs on load and from then on every 4 hours (14400 seconds). + +*You can change it to 24 hours (86400 seconds) if you wish, but I prefer to check more often in case I missed my time slot when my computer was off.* +*If you run this on a machine that's always running like a server then every 24 hours is okay.* + Just substitute `` for your own. +To view all users (to get your username) run: +```sh +dscacheutil -q user | grep -A 3 -B 2 -e uid:\ 5'[0-9][0-9]' +``` + *by daemon I am referring to the .plist file* Navigate to directory: @@ -106,11 +115,8 @@ Edit file: /Users//development/misc/grab_packt/server.js - Nice - 1 - StartInterval - 86400 + 14400 RunAtLoad @@ -126,13 +132,13 @@ Edit file: Load this daemon into the system: ```sh -launchctl load com..grab_pkt.plist +cd $HOME/Library/LaunchAgents && launchctl load com..grab_pkt.plist ``` *to unload just change load to unload* Check output of script: ```sh -/tmp/GrabPkt.out +sudo cat /tmp/GrabPkt.out ``` It should be similar to: ```sh @@ -144,7 +150,7 @@ Claim URL: https://www.packtpub.com/freelearning-claim/13277/21478 Check for errors: ```sh -/tmp/GrabPkt.err +sudo cat /tmp/GrabPkt.err ``` Mine is empty due to having no errors.