Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
Cron is a time-based job scheduler found in most Unix-like computer operating systems, like macOS. Cron is driven by a crontab (cron table) file, a configuration file that specifies commands to run periodically on a given schedule. This tag should be use when dealing with any cron issues.
0
votes
Accepted
Crontab didn't work as intended
no other problems that we can't see*, the following correction should work:
03 04-22 * * * /usr/bin/python /me/radio_alarm.py
It is necessary to specify the complete path to python because the "cron …
0
votes
Accepted
why won't my cron command work?
I don't think cron has a "log file" per se, and so I'll suggest you get into the habit of creating and using a file to capture the output of stdout and stderr from all cron jobs. … It's the best way to troubleshoot mysterious cron issues. …
-1
votes
crontab doesn't seem to recognize `~`
Perhaps Apple uses dash as the default cron shell in Catalina, and bash in Monterey?; perhaps Apple changes the cron environment depending upon the phase of the moon? … Once a day (or whenever you wish), you can run a cron job that logs its environment and some other useful information from your system to a file. …
0
votes
Running Cron with PHP on macOS 12 Throws Error - Could not open input file
Applications/MAMP/bin/php/php7.2.10/bin/php -f /Users/user/Documents/radio_bycron.php >> /Users/user/Documents/radio_bycron.php_output.txt 2>&1
I'm not familiar w/ PHP, but I read the (as revised above) cron … to stdout (1) (effectively capturing both stderr and stdout in the file /Users/user/Documents/radio_bycron.php_output.txt)
My changes were prompted by two potential problems in your version of the cron …
0
votes
Getting unknown command error when trying to run script via cron
Perhaps the easiest way to discover what your environment is when running a job from cron is to ask cron to tell you! … This difference in the PATH environment variables explains the source of an "unknown command" error generated by cron: the command is not on the PATH of the shell used by cron. …
1
vote
Accepted
change default editor for command line tasks?
The editor that is launched when you enter crontab -e at the command line is set in an environment variable. Specifically, the default editor that is launched in your terminal window is controlled by …
9
votes
Accepted
cronjobs do not run
I'd recommend a couple of things:
Make sure cron has Full Disk Access in the Privacy tab of System Preferences (see s/s below)
When creating commands in crontab, help yourself out by writing errors … generated by stderr to an output file using 2>&1, and using full pathnames (your cron job does not run w/ same environment as your user does);
EXAMPLE:
seamus@Dung-Pro ~ % crontab -l
*/5 * * * * /usr …
3
votes
cron queueing bash and python scripts
However, there are additional requirements:
Your cron jobs run with a different ENVIRONMENT than when you run them; e.g. $PATH. … your scripts in the crontab; for example use:
* * * * * /opt/local/bin/python3 /some/dir/you/choose/myscript.py
On my Mac (Catalina) I've found it necessary to give "Full Disk Access" privileges to cron …