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
2
votes
0answers
79 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. ...
2
votes
2answers
39 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
21 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
36 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
65 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 ...
1
vote
0answers
235 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
258 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
76 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 ...
1
vote
0answers
1k 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 ...
4
votes
2answers
137 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
1k 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
708 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
178 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 ...
9
votes
2answers
4k 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
5k 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
1answer
73 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 ...
2
votes
2answers
530 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 ...
3
votes
0answers
33 views

How to force Wi-Fi to rescan available sources and reconnect to a fixed named source from crontab?

I have a server computer running macOS and sometimes is using Wi-Fi only in evenings. The room's router supporting the Wi-Fi source is set to automatically reboot weekly. So when that happens, the Wi-...
1
vote
2answers
454 views

Running Cron Job w/ Sudo permissions

Strictly for learning purposes (possibly maintenance as well) I am trying to have a Cron job empty my trash once a day. I have opened terminal and entered the command crontab -e to access the VI ...
0
votes
2answers
1k views

How to access Keychain of my user from cron?

security list-keychains print: "/Users/vitaly-zdanevich/Library/Keychains/login.keychain-db" "/Library/Keychains/System.keychain" but the same command from cron return: "/Library/Keychains/System....
1
vote
2answers
464 views

How to schedule VLC recording with cron?

I've created the following crontab: 0/5 * * * * /Applications/VLC.app/Contents/MacOS/VLC -I rc rtp://@xxx.xxx.xxx.xxx:5050 --sout='#transcode{vcodec=h264,vb=2048,acodec=mp3,ab=192,deinterlace}:...
4
votes
1answer
5k views

How to check if cron job works?

I use crontab -e without sudo to edit cron jobs and add the following line there - 20 22 23 10 * date "+%Y-%m-%d %H:%M:%S" >> ~/Documents/log.txt then I check the log file and it doesn't ...
1
vote
1answer
787 views

Problems executing an osascript command via cron

I have a little shell script which creates a new reminder for a project. This works pretty fine and I can execute in the command line newCfSamples "my new sample" and the reminder gets created. I now ...
1
vote
1answer
172 views

How to use macports Python in a cron job?

I have installed Python 2.7 through mac ports, and now want to have it used in a cron job. Unfortunatly, each time the cron job gets involved, the standard Python of my machine (an iBook G4 using ...
1
vote
1answer
2k views

Run a command on a schedule and verify that it has run

I want to run an rsync command each day or more often to back up a raspbery pi on my network to a drive attached to my mac. I see launchd, but I'm very confused about how to get it to work, and I ...
1
vote
1answer
627 views

Setting anacron on Mac - Shell Scripting

I set cron to run script every day using env EDITOR=nano crontab -e where I wrote something like this @daily path/to/sript.script. Now I want to use anacron to be sure that script is going to be run ...
0
votes
1answer
66 views

How to control where script run by cron saves files?

I've got the following cron job that runs at 6 am every morning: 00 6 * * * /Users/username/path/to/script/wget.pl 1; The script, written in perl, fetches the latest files from a website. Within ...
1
vote
2answers
138 views

“Temporary” folder

I often download images, take screenhots, and save files that I am only going to use for a little until it can be discarded. I want to create a folder which deletes the contents inside it every few ...
0
votes
1answer
1k views

How can you access Apple Mail from Apple script?

I want to archive old emails ( say, older then 7 days ) from my inbox automatically with an applescript scheduled via cron. To be honest, I am open to other Apple-friendly languages such as Swift or ...
0
votes
0answers
184 views

Where are crontab files stored in OS 10.8

I've already looked at this question: Where is my crontab file? But there is no real answer except for 10.7. I'm trying to migrate crontab from an old drive that I can't boot so using crontab -e is ...
2
votes
1answer
165 views

Bash script with lock folder problems for large files

My script is: #!/bin/bash # Path to a lock folder LOCK_PATH="/Volumes/PROOFS_WATCH/copy.lock" trap 'rmdir "$LOCK_PATH"; exit' 1 6 15 if mkdir "$LOCK_PATH"; then echo "Lock file did not ...
2
votes
1answer
177 views

Cron job fails due to sleeping wifi?

I wrote a cron job to do backups over wifi to another computer. It works perfectly when I'm using the machine, but I prefer to schedule it at night when I'm not using it. The first step is to ping the ...
3
votes
3answers
1k views

Turn off mail notification in terminal

I'm running some cron jobs on my machine and every time I fire up a terminal session I'm getting a 'You have mail.' message. Any way to turn this off?
0
votes
2answers
4k views

Launchd unloading LaunchDaemon

I have a script scheduled to run as LaunchDaemon. Script runs fine when launched manually through terminal. I have two commands sudo launchctl unload -F /Library/LaunchDaemons/com.test.plist sudo ...
1
vote
1answer
690 views

How do I open a URL with a custom scheme in Yosemite with cron and open?

I had a cron job that ran every morning at 10:30 to call into our daily status meeting on Go2Meeting. After I upgraded to Yosemite it stopped working, and I figured out that it was because open -g ...
3
votes
3answers
3k views

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

I have a MacBook Pro from work. To keep my browsing history separate, I use 2 different browsers. (Chrome = Work, Safari = Fun) I want to make my default browswer Chrome while at work (9 am to 6pm), ...
2
votes
0answers
188 views

OSX Server: _www user emailing itself every minute

I'm new to OSX Server, and this has me stumped. For some reason _www user is emailing itself every minute. I've tried to restrict it in postfix config, both sending & receiving, i've removed ...
3
votes
2answers
3k views

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

I would like to run a Python script each time it finishes and I think I can do this with cron but I am not sure how to do it. The idea is each time the Python scripts ends, it will have to run again ...
1
vote
1answer
1k views

Cron job keeps running, not in any crontabs

Some time ago I set up a cron job that would run a shell script to update my dynamic DNS. I've since done the proper Mac thing and switched over to launchd to handle that job and any other scheduled ...
2
votes
1answer
88 views

How Can I Log Crontab File Writes

I'm looking for a way to log crontab file writes. A friend of mine pranked me, and did something that occasionally adds */5 * * * * say "deranged" "The current time is `date`" I haven't been able to ...
1
vote
1answer
170 views

Cron configuration on Mavericks

How can I configure cron to send a local email only to the crontab owner with the cron job output. This worked with Lion, could check the cron emails by just running mail in the terminal so I don't ...
1
vote
1answer
335 views

AppleScript working until placed in cron; causing Chrome to go unresponsive

Good afternoon. Question: I have a simple apple script telling Google Chrome to open, go to a URL, and enter presentation mode... tell application "Google Chrome" activate make new window ...
5
votes
0answers
321 views

How daylight saving changes are handled in launchd to make sure it execute the the jobs as scheduled through plist?

Since August 2013, I am using Mac Mini with OS X version 10.8.2 as my web server (MAMP stack). I have a few launchd scheduled jobs scheduled through plist. Everything was working fine until Nov 3, ...
1
vote
1answer
680 views

How do I setup a cron job on OSX to launch a website in safari every 4 hours?

How do I setup a cron job on OSX to launch a website in safari every 4 hours? I'm looking to have it open on top of every window. It's basically a reminder for staff.
12
votes
5answers
22k views

Cron script not executing on Mavericks

I have configured a user crontab file as follows: */2 * * * * /Users/[my user]/Dropbox/htdocs/auto-update.sh But it won't execute. I waited for, like, 10-15 minutes. Why? Command auto-update.sh ...
1
vote
1answer
109 views

emulate Linux's `last -x` on Mac OS X

I'm currently trying to get a missing cronjob runner script thing to work, but it was written for Arch Linux, which is pretty different from Mac OS X, and one of the things that it tries to do is run ...
7
votes
2answers
2k views

What is the difference among the various event schedulers for OS X / Darwin?

I'm confused about the differences among the three (that I know of) tools for scheduling running of code on OS X / Darwin: cron launchcd pmset I understand that cron is largely deprecated, but it is ...
2
votes
0answers
670 views

MacBook Pro with lid closed goes back to sleep right after scheduled wakeup

I'm trying to run an app from crontab at 3 in the morning. My 2010 MacBook Pro running OS X Lion 10.7.5 is usually turned off at this time of the night, so I'm setting Energy Saver's scheduled wake up ...
0
votes
1answer
87 views

Scheduling cronjobs at specified time

I have scheduled some jobs in crontab which are to be run one by one, at some specific time. My script for crontab is : 15 10 * * * /Users/sri/files/BatchFF.sh 45 11 * * * /Users/sri/files/BatchGC.sh ...