The pmset terminal command should do what you want. The following will put the computer to sleep at 23:45:00 on December 2, 2014. The command must be run from an administrator account though:
sudo pmset schedule sleep "12/02/14 23:45:00"
The MM/DD/YY date format cannot be changed; so, if you are used to a different format, use caution.
If you do this on ...
This is possible in iOS 14 using the Shortcuts app. You have to create an automation to enable the airplane mode in the evening and another automation to disable it in the morning.
I used the following:
At 22:30 → Airplane mode ON
Disable “Ask before running”
The same process for the morning
At 5:30 → Airplane ...
Others have already answered why cron was superseded. As for the other question:
will it eventually be completely removed from future releases?
cron is a required utility/service of the POSIX and Unix standards. Thus, there are only two circumstances under which cron would actually be removed from macOS:
Apple decides that being an officially certified ...
By default there is no way of doing that with the options you have in the system preferences.
But, you could do it from command line with a simple command:
sleep 10; osascript -e 'tell application "System Events" to sleep'
sleep 10 pause the execution of the following command for 10 seconds. If you want minutes or hours you must change 10 with number of ...
Apple does not allow apps to "play with" that system setting. That's the technical reason why there's no app for it. It might be able using a jailbreak tweak if it has to change every day (for example: monday between 2 and 4, tuesday between 2 and 3 etc.)
However if you go to:
Do not disturb
Pick the time of your desire
For iOS 12 and older, it's not possible to schedule Airplane Mode unless you have a jailbroken device. If you want to jailbreak your iPhone, there's a few apps that do this exact thing.
This sounds like it would be a good idea so I recommend you let Apple know you want this on their iPhone Feedback page.
There is no feature for automatic turning off with no jailbreak.
However, you can:
Schedule "Do not disturb mode" and it will not turn you screen on to show useless notifications
Manually turn on "Low power mode" to stop all background processes and save your battery.
Plug it into a power source with no worries, since iOS 11.3 iPad has a new "iPad Charge ...
You could use Do not Disturb mode. Found under Settings / Do Not Disturb or in Control Center (the moon icon), this mode silents calls, alerts and notifications and it can be scheduled to be automatically enabled between specified hours.
Based on @Gintaras's answer, since you can run a shortcut from a shell script, I was able to get it done - but not with launchd.
Instead, I created a new application in the Automator app, to run a shell script, with the contents:
shortcuts run "Email Schedule to Yourself"
Then I added a recurring calendar entry at ...
Print Job scheduling was removed in OS X 10.7 Lion. As a workaround, you can pause the printer, print what you want then continue the printer.
You can provide feedback to Apple regarding this on the following page:
In recent versions of OS X launchd is preferred to cron. Here's an excerpt from man crontab under Mavericks:
Darwin note: Although cron(8) and crontab(5) are officially supported under Darwin, their functionality has been absorbed into launchd(8), which provides a more flexible way of automatically executing commands.
You can control launchd using the ...
This is just a slightly more efficient re-hash of the existing answer...
set gIsThisTime to false
repeat until gIsThisTime is true
set myTime to time string of (current date)
if myTime > "1:15:00 pm" and myTime < "1:20:00 pm" then
set gIsThisTime to true
set myDate to date string of (current date)
TL;DR Summary: launchd is "better" than cron in many ways, but these sorts of repetitions are an example of one way where cron is easier than launchd. To do this in launchd is excessively verbose. (That link will take you to a gist because it is literally too long to post to StackExchange.)
Keyboard Maestro supports cron-style execution times. If I ...
Related question on Stack Overflow:
Scheduling a terminal command or script file to run daily at a specific time Mac OS X
People are using launchd to achieve this. Personally, i use mysql server events with lib_mysqludf_sys-master and dedicated table replicating events. Hard to setup everything, but it's very convenient to add/edit/remove jobs by simply ...
Scheduler for MacIntosh is a gui-based task scheduler for macOS can be downloaded at https://macscheduler.net/. Been using it to run a backup app I wrote. Runs in background, doesn't need to be opened at startup. Can launch apps, scripts, docs.
For power control of your Mac from your iPhone on a local network, I have used Off Remote which can also schedule within the next 24 hours a system action (Shutdown, Lock, Restart, Log off, Sleep) and is only $3 in the iOS store but requires installation of an additional helper app on your Mac to receive the instructions from the iPhone app.
Another answer ...
The traditional approach, e.g. with cron jobs, is to pipe standard error to a program like mail that's smart enough not to send you empty mail. The difference with launchd, as you've discovered, is that the mechanism for redirecting standard error is giving a StandardErrorPath for it to be written to, which isn't as convenient for this purpose as ending your ...
Open Automator and do something like this.
Use Workflow + Drag New Calendar Event to the right. Choose the time+date. Choose what file to open.
Obviously set the date/time and choose the right file to Open.
You can't add a crontab entry by just running crontab <entry details>. In your case the shell expands the * with whatever filenames it finds in the current directory (which seems to be a file called LICENSE, replace crontab by echo to see what happened to the other *'s).
To add new entries to the crontab file run
Run a script at start-up or login. Within the script, run a check to see if sunrise has recently occurred. If so, perform the iTunes script.
Your script needs to determine how long ago sunrise occurred. If the time since sunrise is short enough, run the script. Short enough might be five minutes ago; it is unlikely a Mac is restarted within five minutes of ...
No. You can't create a recurrence for this granular of a rule set.
I'm paid every month;
I'm paid always on the last possible day before the 28th day of the month;
I'm paid always on a working day.
So, to simplify it, you're paid the 27th of every month unless it's a weekend or holiday, then you're paid the previous workday.
Your options are as follows:
If there is a “right” way from Apple’s point of view, then it’s launchd. Not that cron is “wrong” per se but it is not the “preferred” way.
However, as you indicated, launchd can be a pain to work with.
There are two good apps to try:
Lingon has been around for a long time ...
A cron job, something like
0 6 * * * killall Mail && open -a "Mail.app"
You can run as complicated a script as you want like the following
0 6 * * * sh path_to_the_script.sh
Add it to cron with crontab file_above.txt
See man crontab for more info.
Thanks everyone just got this working! The first answer did work. My issue was that I didn't unload the first launchd .plist even though I deleted the file. It keep remembering it on each restart.
I ended up re imaging two iMacs and tested the launchd .plist with the added command.
Tested with loading it and unloading it to confirm. After countless ...
As far as I'm aware there's no way to change this value because a Mac must be awake for at least 10 minutes past the scheduled time. It's because of this that the 10 minute value is set and cannot be altered, although I suppose there's no reason why it couldn't be extended beyond that (such as the 30 mins you want). Regardless, I'm not aware that this can be ...