Edit: This question is NOT a duplicate of How do I restart the cron service on OSX? as I explained in point 3...
I am busy trying to test a process that's started using the crontab on macOS High Sierra. I cannot seem to kill it easily so that I can make a change and re-run it to test my change.
I can tell what the cron process is doing as I am logging the output/process to a text file and tailing -f it in terminal, anything I have tried hasn't stopped the job.
Here's what I have tried:
Listing processes (aux) via
ps aux | grep crondoesn't list anything that looks like my currently runningcronjob.ps -ef | grep cronshows three processes but none of them are the job itself as far as I can tell, list shown below:0 41453 1 0 12:55pm ?? 0:00.01 /usr/sbin/cron 503 38049 37800 0 12:04pm ttys002 0:00.24 tail -f cron-test.txt 503 42548 38511 0 1:24pm ttys003 0:00.00 grep --color=auto --exclude-dir=.bzr --exclude-dir=CVS --exclude-dir=.git --exclude-dir=.hg --exclude-dir=.svn cronI tried unloading/loading the launch daemon (How do I restart the cron service on OSX?) which
cronis run through but, trying to do this requires that System Integrity Protection be disabled. Doing this requires me to reboot in recovery mode which is pointless, I may as well then just reboot the Mac everytime.
crontab -l output in case its relevant.
*/44 * * * * cd /Users/my_user_name/Development/Sites/website-handover-dev/web && \
./cron-test.sh && \
time ./cron-test.sh >> /Users/my_user_name/Development/Sites/website-handover-dev/web/cron-test.txt 2>&1
crontabentry or entries from the user'scrontab.cronwakes every minute, checks if a entry needs to be run, and also checks the modification time of a crontab,. Thus the crontab entry will be stopped if removed. There is no need to stop and restart cron. – fd0 Jun 06 '18 at 13:06cron-test.shscript run? – nohillside Jun 06 '18 at 13:12grep croncatch the process name? Wouldn't the process thatcronstarted run under its own name? Also - are you using the same userid for your commands that the crontab is using? – Seamus Jun 06 '18 at 17:31