Questions tagged [cron]

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.

Filter by
Sorted by
Tagged with
0
votes
1answer
16 views

Cron job cannot find ffprobe/avprobeor ffmpeg/avconv even though its installed

I have a cronjob setup to run "/Users/admin/Scripts/youtubedl.sh" Script: cd "/Users/admin/Music/youtubedl-music" /usr/local/bin/youtube-dl -o "%(title)s.%(ext)s" --...
1
vote
1answer
27 views

“sudo crontab -e” not updating /etc/hosts

In my /etc/hosts file, I have records like this: 127.0.0.1 www.youtube.com To keep me from getting distracted. When I need something on one of the sites I have blocked, I add # to the beginning of ...
2
votes
1answer
34 views

How create a crontab on mac?

I'm trying to create a crontab on mac. I've tried crontab -e which takes me to what appears to be an empty file opened with vim. I make no changes and simply press esc, :, w, then q to save and exit. ...
1
vote
1answer
28 views

Running Cron with an updated Bash version

Is there a way to get cron to run with an updated version of Bash that's been installed? My OS came with Bash 3.x installed stock and I've upgraded it to 5.x with macports. When I query bash --version ...
1
vote
2answers
44 views

Cronjob macOS does not work if set with a bash external script

I'm trying to create a new cronjob which launches a script every time at startup. If I do cronjob -e and then I insert for example @reboot bash /Users/user/script.sh and then I save everything is fine:...
2
votes
1answer
30 views

Crontab -l command working. No other crontab command is working

New to crontab, I wanted to experiment. Running the command crontab -l gave me the following answer crontab: no crontab for User_1 Every time I tried to issue a command like 1 16 24 10 6 ping -D -c 1 ...
1
vote
2answers
34 views

cron queueing bash and python scripts

I'm currently looking to understand and get comfortable with crontab queues on my macbook pro. I recently solved an issue where my simple bash script would not execute. It turns out I had to move my ...
4
votes
2answers
76 views

cronjobs do not run

I have recently switched from Ubuntu to MacOS. I tried to run the exact same cronjobs I ran on Ubuntu before, however they don't, and after trying to figure out if the crontab entries might have any ...
0
votes
0answers
25 views

Granting cron permission to control Finder

I aim to use cron to call a python script that changes my desktop background. The key python line is as follows: from appscript import mactypes, app app('Finder').desktop_picture.set(mactypes.File(...
1
vote
1answer
155 views

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

I have a script that copies a file from our server to the local machine. Here is the script and output + date Thu Jun 11 09:16:00 ACST 2020 + id -un root + pwd /Volumes/Macintosh HD/backups + mkdir /...
0
votes
1answer
33 views

Trying to add cronjob results in “”LICENSE“:0: bad minute”

I am trying to set up a cronjob to run every minute with the following command: crontab * * * * * sh /Users/username/Downloads/reddit-notifications-master/notifyer.sh notifyer.sh has the following ...
0
votes
0answers
18 views

Reactivating console mail logging from cronjobs

I am running several cron jobs on a Mac server. Some time ago I don't know why I deactivated the cron logs into the local mail of the system. I now am getting errors running those cronjobs and I am ...
0
votes
1answer
25 views

Issue with “date” command in MacOS Mojave

I think this is a "Full Disk Access" problem. I have added "Terminal" and "cron" to Full Disk Access. The problem is when I am trying to use the command below, it works from Terminal but not with ...
1
vote
1answer
442 views

how to automate / run 'brew cask upgrade' as a cron job?

I wish to run brew cask upgrade in a cronjob, but it prompts for a password. When I run the job as root all permissions are screwed up. Howto run that command in a cronjob env? I use zsh. ~ brew ...
0
votes
0answers
174 views

command silently failing when running from the root's crontab

I have a script that runs diskutil and since diskutil needs permissions to run I'm running the script from the root's crontab. Steps: sudo su root crontab -e sh /test.sh Nothing ever happens ...
15
votes
1answer
4k views

Crontab Operation not permitted

I have the following crontab on my mac OS Catalina 10.15.1 : * * * * * /Users/username/Desktop/cronjob.sh > /Users/username/Desktop/cronjob.log 2>&1 Within the command file is: #!/bin/...
4
votes
1answer
1k views

rsync in cron on Catalina no longer working

I have various rsync entries in crontab that worked reliably right up until the moment I upgraded to Catalina. 00 04 * * * /usr/local/bin/rsync --archive /Volumes/FOO me@remote.example:BAR Here ...
2
votes
2answers
1k views

cron lacks permissions to run a script

I have a script (which backs up, using rclone) that I can run from the Terminal or Automator after chmod a+x, with no permissions problems. However, when this script is run in cron (or launchd), ...
3
votes
1answer
52 views

Launch app in foreground doesn't work from cron, but does from terminal

I have the following: * * * * * open -a /Applications/TextWrangler.app/ ~/notes.txt; open /Applications/Notes.app Neither of the 2 apps brings focus to the foreground (though they do get launched ...
8
votes
3answers
2k views

“cron” processes spawning and piling up, but no crontab

EDIT: I solved this, so see below for my own answer. While the bounty asks for a fix to the problem, I'd like to award it to someone who can explain why a cron process that ran for 6 years over ...
11
votes
1answer
3k views

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

I have a USB disk, that takes ages to spin up after it has gone to sleep. So in the past I used either a cron job to regularly touch a file on it, so it will never spin down. */5 * * * * /usr/bin/...
10
votes
3answers
2k views

“cron” processes piling up

I have cronjobs doing various cleanup tasks: $ crontab -l 0 * * * * find ${HOME}/Downloads -depth 1 -d -mtime +12h -exec /usr/local/bin/trash {} \; * * * * * /usr/bin/defaults delete com.apple....
1
vote
1answer
329 views

Shell command works fine as is, but not when executed from crontab. What's the difference?

I created a small workflow with the Automator App, and I want it executed periodically. For that I created an entry in crontab. The problem is that running the workflow straight from the Terminal ...
1
vote
1answer
94 views

File works manually; does not work with cron; setting PATH makes it worse

So I've got these three scrips: one moves pictures to a file (photosscript2.sh), one deletes pictures over 7 days old from that file (photosremove.sh), and one calls both files to keep the folder ...
1
vote
1answer
35 views

Cron job running (?) and output file is being logged every night at 1:35am, but there is nothing listed in crontab -l

I recall creating a cron job that runs a shell script that deletes files that are 45+ days old. When I was editing crontab -e I set it to also output a log to a date stamped log file to ~/Logs. I ...
2
votes
0answers
849 views

How to create a cron log file in macOS High Sierra

I have an issue with cron in macOS High Sierra. I have cron running, and it is running the jobs I want to run. I am unable, however, to figure out how to make it create a cron.log file in /var/log. ...
0
votes
0answers
217 views

tmux + iTerm2 - no permission to edit crontab

I am running macOS 10.14.5, iTerm2 build 3.2.8, tmux 2.9a (tmux -V). I've granted both iTerm2.app and Terminal.app (file permission: .r-xr-xr-x) Full Disk Access (FDP) in Sys prefs > Security and ...
2
votes
2answers
113 views

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

So, I have an external HDD which is being used for Time Machine. After getting to home, I usually connect my MacBook to a HDD via Hub and put it into sleep mode. Because I sometimes get back home ...
1
vote
0answers
64 views

Change permissions of a folder with cronjob [duplicate]

I have a scanner that can "save to folder" only with FTP or CIFS protocols. I managed to set it up with CIFS to save the file to a shared folder on a Mac, however although the folder has read/write ...
1
vote
1answer
52 views

change default editor for command line tasks?

I want to create a cron job. Launching a terminal window, and entering crontab -e opens my current crontab, but opens it in the editor vi. I would prefer to use the nano editor. How do I configure ...
2
votes
1answer
97 views

Can I view local/unix mail (`mail` in the Terminal) in Mail.app?

I use cron to run some jobs, but since that's the only thing I use my unix mail for, having this run through Mail.app would be a nicer experience than seeing "You have new mail." in the Terminal. How ...
2
votes
0answers
393 views

Auto logout inactive users

My iMac is set up using Parental Controls to limit how long my kids can use it. When their time is up, they are no longer able to use the iMac. However, their accounts are not logged out, and ...
0
votes
1answer
72 views

Crontab didn't work as intended

I set crontab but nothing happened, crontab -l 03 04-22 * * * python /me/radio_alarm.py What's the reason, the command works as intended in Linux.
0
votes
1answer
342 views

Cron mail notifies error of suspicious unknown script

Thanks to the mail function of the Terminal it came to my attention that there was some kind of cron job being executed with some errors. The mail of the cron gives this info: 2018-08-02 23:47:22....
2
votes
1answer
112 views

Run backup script at any time every weekend (using launchd?)

I recently lost configuration of one of my IDEs (deleted it myself, I am very smart). I had a backup but it was a few months old. I have a script to backup all my config and push it to GitHub. I was ...
2
votes
1answer
352 views

Can't open crontab

I tried running crontab on my Mac for the first time and got the following: $ crontab -e crontab: no crontab for User - using an empty one crontab: subl -w: No such file or directory crontab: "subl -...
2
votes
0answers
3k views

How do I kill a currently running cron job on macOS High Sierra

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 ...
0
votes
1answer
1k views

Run cron script at wakeup [duplicate]

I would like to run a script at wakeup. So my laptop is sleeping, I open the lid, and the script should run immediately or within the minute after wakeup. This script should run at startup as well, as ...
4
votes
2answers
205 views

error code 4960 when saving a .plist

I'm trying to create a .plist file in textwrangler, something I've never done before. I'm using these instructions which tells me to: Save code as com.rTask.plist file under path ~/Library/...
1
vote
2answers
3k views

Mac mail mail from cron

From sandeep@Sandeeps-MacBook-Air.local Fri Mar 23 20:04:23 2018 X-Original-To: sandeep Delivered-To: sandeep@Sandeeps-MacBook-Air.local From: sandeep@Sandeeps-MacBook-Air.local (Cron Daemon) To: ...
5
votes
3answers
2k views

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

Due to APFS having a mind of its own and filling the hard disk with unwanted snapshots, I made a cron to run tmutil deletelocalsnapshots xxx. Later I found out that running this command while a backup ...
1
vote
1answer
251 views

Stop cron daemon “symmetrical.xm” error messages in Terminal mail

After upgrading to High Sierra (I think) I've started receiving the following message almost every time I start up Terminal: You have new mail in /var/mail/MyUsername I had some problems upgrading ...
10
votes
2answers
5k views

Is cron command supposed to work like this?

I've set up cron to run a script hourly but when I reboot cron does not work. Does this mean that I should run cron whenever I boot into my Mac? The cron command which I use cron 5 * * * * path/to/...
2
votes
2answers
10k views

cron and “command not found”

I'm setting up a cron job to run an executable bash script which contains a pypdfocr command. Whenever I manually execute the script everything works as expected, if instead I use cron with this ...
0
votes
0answers
30 views

Is there a way save with cron?

Is there a cron command that go into a specific App and save? Or, another way around, how to save an App with a bash script? (and run the script with cron). Running OS 10.11
1
vote
2answers
571 views

rsync cron job for backup not working

I'm trying to run a backup from one HDD to another at 10pm everynight on a Mac Pro. I have tested the rsync and it backups just fine outside of the cron table. Here is what I have and it's not running ...
1
vote
1answer
88 views

save mysql backup to afp network drive fails as cron job

For some strange reason I am not able to save a generated mysql backup via mysqldump to an afp network drive as a cron job. If I call the shell script as root user (login via sudo su in terminal), it ...
1
vote
1answer
229 views

Bash script for /etc/crontab

I want to run after every reboot, with no user logged kextunload /System/Library/Extensions/AppleHDA.kext I tried to do a bash script here : #!/bin/sh PATH=/usr/local/bin:/usr/local/sbin:~/bin:/usr/...
2
votes
2answers
689 views

Show dialog at login (bash script)

The idea is that when somebody logs in to my Mac, a popup will show up and the date/time are written to a log. I run the bash script from a cron job: @reboot ~/Develop/login.sh (I know about ...
0
votes
1answer
838 views

Crontab and session locked

I would like to execute a script on my machine every five minutes, even when I am not in front of my mac OS X Yosemite. Therefore, I would like to lock my session and shut off the screen while the ...