Hot answers tagged

48 votes
Accepted

Crontab Operation not permitted

In your case you have to add cron as "parent" app to the user's Security & Privacy > Privacy > Full Disk Access apps/execs. Depending where to read the script from and where to ...
user avatar
  • 63.7k
34 votes

Where is the cron log file in MacOSX Lion?

By default, "logging" is not enabled. But you may get some useful information by running the mail command. TL;DR on the mail command: press enter to read messages, and then q and enter to quit.
user avatar
28 votes
Accepted

On Catalina, how can a cronjob get permission to touch files on a USB disk?

You need to grant cron full disk access. Drag /usr/sbin/cron into the Full Disk Access area in System Preferences > Security & Privacy > Privacy tab. Source: https://twitter.com/DaveWoodX/...
user avatar
  • 3,850
16 votes

Where is the cron log file in MacOSX Lion?

I was able to find cron-job log in, /var/mail/{user-name} Following is a cron job log I got for running an AWS CLI command, From build@BuildServer1.local Fri Mar 2 10:00:00 2018 Return-Path: <...
user avatar
  • 261
9 votes

How can I set the default browser depending on time of day?

Not nearly as complicated, but perhaps of value, is the app Choosy. It allows you to choose your browser every time you open a link outside of a browser. While this might sound onerous, it's actually ...
user avatar
  • 349
9 votes
Accepted

How do I know if a time machine backup is running?

The canonical way to check status of time machine is to use the utility and check status or for newer os check the current phase only: tmutil status tmutil currentphase Now, you have to process ...
user avatar
  • 217k
8 votes
Accepted

Is cron command supposed to work like this?

You don't need to call cron directly. Any commands you want to run need to be added to the crontab of the user they should run as. You can edit your crontab by running crontab -e or, if you are an ...
user avatar
  • 84.4k
8 votes
Accepted

rsync in cron on Catalina no longer working

This requires adding cron to the Full Disk Access list. Open System Preferences : Security & Privacy : Privacy : Full Disk Access Both rsync and cron must be included on this list. Before ...
user avatar
7 votes
Accepted

Will a crontab job wake OS X up from sleep?

cron doesn't execute while the computer is asleep. So cron can't wake your system. See: https://superuser.com/a/14846/246895
user avatar
6 votes

How can I set the default browser depending on time of day?

Expanding on my comment above.... See the comment by user kerma at this related StackFlow article His little command line app at https://github.com/kerma/defaultbrowser does what you need. He ...
user avatar
  • 1,820
6 votes

How to check if cron job works?

Your cron error message are sent to the mail account of the user that is running the cron job. Type mail at the command line to see the messages. For a list of mail commands, see man mail. You ...
user avatar
  • 81k
6 votes

cron and "command not found"

When cron runs an event, it uses the default shell environment of the running UID. However, no "profile" customization is applied, i.e. your .bash_profile is not sourced and thus any PATH settings are ...
user avatar
  • 2,042
5 votes

Cron job keeps running, not in any crontabs

You may want to check the following location, as this is where OS X stores crontabs: /usr/lib/cron/tabs/ There may be a crontab which is stored there which is running your job. This is a directory ...
user avatar
  • 4,092
5 votes

Is cron command supposed to work like this?

On macOS High Sierra (and perhaps earlier), cron is disabled in some configurations. There is, however, still a LaunchDaemon for it. Check to see if cron is enabled: sudo launchctl list | grep cron ...
user avatar
5 votes
Accepted

"cron" processes piling up

Redirect stderr to /dev/null as well as stdout: * * * * * /usr/bin/defaults delete com.apple.Spotlight userHasMovedWindow &> /dev/null * * * * * /usr/bin/defaults delete com.apple.Spotlight ...
user avatar
5 votes
Accepted

"cron" processes spawning and piling up, but no crontab

So I found a relevant answer here: Cron job keeps running, not in any crontabs I don't think this question should be removed because this seems to be relevant to Catalina, even though it seems to be ...
user avatar
  • 131
4 votes

Cron script not executing on Mavericks

It's been a while that you asked this question, but it seems that no solution came up in this thread. Depending on the way you create a user-crontab, it might be necessary to execute this after ...
user avatar
  • 141
4 votes
Accepted

Bash script for /etc/crontab

The script errors because you have split the command in two lines. Basically you want to remove the newlines between the PATH and the kextunload lines, so it looks like this: #!/bin/sh PATH=/usr/...
user avatar
4 votes

error code 4960 when saving a .plist

You are trying to create a launch agent with: the wrong extension (plis) in the wrong folder (/Library/LaunchAgents/ (suggested by the visible plists: java oracle/microsoft? updater, google keystone ...
user avatar
  • 63.7k
4 votes

'Operation not permitted' accessing SMB Share as root under Catalina

I had the same problem and it was fixed by granting »Full disk access« to Terminal in System preferences -> Security & Privacy -> Privacy and restarting Terminal. Click the lock at the ...
user avatar
  • 141
3 votes

Turn off mail notification in terminal

It's likely to be in the spool file: /var/mail/$user. Because sometimes your mailbox will contain important messages (a failed cronjob task, etc.) you don't to check it every time by yourself. Also, ...
user avatar
  • 2,286
3 votes
Accepted

How to run a cron job each time the previous execution has finished?

In terminal: while :; do ./script_name; done or while :; do python programm.py; done If you want add some sleep time before run program again use 'sleep' command: For example: while :; do python ...
user avatar
3 votes

Where is my crontab file?

It should be noted that if you aren't accustomed to using vim (the default crontab editor) then you can specify your editor as follows: VISUAL=nano crontab -e
user avatar
3 votes

Crontab task "LSOpenURLsWithRole() failed ... with error -600 for the file ..."

As noted in the other answer the error is because you are trying to run a GUI app when not logged in. However in your case why are you using a GUI app (Terminal ) here. Just call your scripts ...
user avatar
  • 26.9k
3 votes

Running Cron Job w/ Sudo permissions

If you want to specify the the root user's crontab, you have to use the -u option. sudo crontab -e -u root That said, there's a safer way to clean out your trash than just removing the whole ...
user avatar
  • 81k
3 votes
Accepted

How to get macOS Wi-Fi device name programmatically in Bash script?

In your question I know you used networksetup -listnetworkserviceorder however I'd use networksetup -listallhardwareports instead as it's easier to parse the output using awk, by itself, with a ...
user avatar
  • 53.1k
3 votes
Accepted

save mysql backup to afp network drive fails as cron job

Found the solution: The problem was, that the mysqldump command could not be find. I needed to add the absolute path to it /Applications/MySQLWorkbench.app/Contents/MacOS/mysqldump Thanks to patrix ...
user avatar
  • 223
3 votes

How do I know if a time machine backup is running?

Undocumented tmutil status There is an undocumented, and thus subject to change, tmutil status. This call returns the response: Backup session status: { ClientID = "com.apple.backupd"; ...
user avatar
  • 39.9k
3 votes

Can't open crontab

This is a known problem with crontab and the EDITOR variable which you must have set to subl -w. To quote from the man page of bbedit: Some tools (notably crontab), will not work correctly if your ...
user avatar
3 votes
Accepted

What is the best approach to ejecting disk while in sleep mode, scheduled?

I think the Energy Saver suggestion is a good place to start:  » System Preferences » Energy Saver » Schedule and set it for, say, 30 minutes before you want to leave for work. However, I would not ...
user avatar
  • 19.2k

Only top scored, non community-wiki answers of a minimum length are eligible