Scheduler in mac os

Вики IT-KB

Пошаговые руководства, шпаргалки, полезные ссылки.

Инструменты пользователя

Инструменты сайта

Боковая панель

Содержание

Приложение «Календарь» в качестве планировщика задач в macOS

Приложение «Календарь» в macOS может выступать в качестве планировщика задач. Чтобы задание работало, необходимо создать событие локальном календаре, а в качестве «напоминания» настроить открытие файла.

В данном примере 30 сентября в 09:00 будет открыт калькулятор.

В качестве открываемого файла можно выбрать любое другое приложение, процесс Automator или текстовый документ, что угодно.

Понятно, что просто открывать файлы или программы по расписанию мало кому интересно, поэтому рассмотрим пару задач, которые могут быть действительно полезны.

Планируем автоматическое переключение в тёмное и светлое оформление

Как известно в macOS 10.14 Mojave появилась, так называемая, тёмная тема. Многим она пришлась по вкусу, но мне неудобно использовать её утром и днём. Почему инженеры Apple не предусмотрели автоматическое переключение как в tvOS?

Для самостоятельной настройки автоматического переключения воспользуемся «Уведомлением» календаря в Automator.app.

Добавим единственный шаг — Запустить AppleScript, и вставим тело скрипта:

На месте можем проверить работу, выполнив скрипт:

Сохраняем задачу ⌘+S, присваиваем имя, например, Switch dark mode . После сохранения в приложении Календарь появится новый локальный календарь с именем Automator , в котором будет наша задача. Система сделает попытку выполнить задание и ОС спросит на это разрешение.

Нам необходимо двойное переключение, так как утром необходимо светлое оформление, а вечером тёмное. Продублируем задачу в календаре. Первую настроим на запуск каждый день, например, в 09:00, а вторую, например, на 16:00. С этого момента, каждый день оформление ОС будет автоматически переключаться.

Планируем автоматическую отправку SMS для запрета мобильных подписок

Так сложилось, что мобильные операторы нашей страны грешат тем, что разрешают себе любимым и всяким мошенникам автоматически подключать различный «премиум контент» за невменяемые деньги. При этом пользователь мобильного интернета может и не подозревать об этом до тех пор, пока счёт не будет на нуле. А с учётом авто-пополнений баланса мобильного ситуация может стать печальнее.

У любого мобильного оператора есть возможность отключить разрешение подписок, но проблема в том, что отключение временное и действует только 3 месяца.

Оператор связи, которым я пользуюсь, предлагает отключать возможность платных подписок следующим образом: необходимо отправить два SMS на номер 5151 с текстом УСТЗАПРЕТ1 и УСТЗАПРЕТСП .

Так как номер мобильного телефона связан с iMessage, и каждый пользователь связки Mac+iPhone может отправлять SMS-сообщение с компьютера, у нас появляется возможность автоматизировать процесс отправки SMS с помощью Automator.

Аналогично первому примеру, создадим «Уведомление» календаря и добавим единственный шаг — Запустить AppleScript и вставим тело скрипта:

Сохраняем и настраиваем выполнение задачи раз в 3 месяца.

Все созданные уведомления календаря располагаются в

Так же macOS имеет стандартные для Linux консольные планировщики: cron, at.

Проверено на следующих конфигурациях:

Версия ОС
Apple macOS Mojave (10.14)

Автор первичной редакции:
Виталий Якоб
Время публикации: 13.10.2018 16:49

Источник

[FAQ] Автоматический запуск программ на Маке по расписанию… через Календарь

Если вы хотите увидеть на нашем сайте ответы на интересующие вас вопросы обо всём, что связано с техникой, программами и сервисами Apple, iOS или Mac OS X, iTunes Store или App Store, пишите нам через форму обратной связи.

К нам поступил следующий вопрос:

Нужна помощь в поиске софта, который мог бы запускать и выключать установленные программы по расписанию. Я новичок в использовании Mac. Пробовал искать сам, но находил только информацию о приложениях по тайм-менеджменту типа: сходить за молоком, сделать то, сделать это и т.д. Решил не тратить время и спросить здесь. В общем, нужен просто аналог «планировщик задач Windows», как я и написал в теме. Помогите!

Возможность настроить автоматический запуск программ на Маке по расписанию встроена в главный инструмент планирования, предлагаемый в составе OS X – Календарь (бывший iCal). Но спрятана она настолько хорошо, что найти её сможет не каждый маковод со стажем, не говоря уже о новичках. Запуск любого приложения и любого файла можно привязать к любому запланированному событию в Календаре.

Дважды кликните по нужной дате в Календаре, чтобы вызвать окошко создания нового события. Задайте нужное время, при необходимости выберите интересующие вас настройки повторения события:

Обратите внимание на секцию «Предупреждение» – это именно то, что нам нужно. В списке возможных вариантов предупреждений выберите пункт «Настроить» в самом низу:

Вы увидите расширенные настройки предупреждений:

Нажмите на «Сообщение со звуком» и выберите в выпадающем списке пункт «Открыть файл». В выпадающем списке ниже выберите пункт «Другой» и укажите путь к нужному файлу программы. Наконец, в последнем выпадающем списке выберите «в момент события». Должно получиться что-то вроде этого:

Всё. В момент наступления события Календарь не только оповестит вас об этом, но и автоматически откроет выбранную вами программу.

А для тех, кто считает данный способ наладить автоматический запуск программ на Маке слишком мудрёным, предусмотрены многочисленные альтернативы, например, Power Manager.

Источник

4 Easy Ways to Automate Your Mac’s Schedule

Your Mac comes with lots of ways to schedule tasks, but not all of it’s ready to go out of the box. Beyond automated maintenance, OS X has a lot going for it, but you have to put in a bit of elbow grease to get everything working how you want it and on your schedule. In this tutorial we’ll look at four ways you can automate and personalize your Mac’s schedule in OS X.

We’ll take a whack at a dead simple third party app, play around in System Preferences a bit, and try out a couple of scheduled workflows in Automator. Hit the jump to follow along.

1: Startup & Shutdown

This is one of the easiest automations on the Mac, and it’s native to OS X. Beyond convincing your roommate that your MacBook Pro was built on an ancient burial ground and ghosts are shutting it on and off, there are some pretty good reasons to have your Mac take care of these functions itself. Your Mac can boot up to perform routine maintenance while you’re asleep or at work, or shut itself off to save power when you’ve fallen asleep watching a movie. It can startup first thing in the morning to save you a step and a minute or two in the course of your day.

Your Mac can boot up to perform routine maintenance while you’re asleep or at work.

Here’s how you do it. Open System Preferences, either from Utilities in Applications or by clicking the Apple Menu. Choose Energy Saver and click Schedule.

You can choose to startup/wake your Mac at a set time on a specific day of the week, just weekends, weekdays, or everyday. The second checkbox allows you to apply the same choices to when you want your Mac to sleep, restart, or shutdown, but you can only choose one of those three actions.

It’s important to note that if you have a MacBook Pro or MacBook Air, this tip will only work if your Mac is plugged into a power source. If you fall asleep with your Mac unplugged or your cat has a tendency to use your adapter plug for batting practice at night, your Mac won’t startup as advertised.

2: Regular Maintenance

Once your Mac is moving around at 2 AM while you’re sleeping, raiding the fridge or making calls on Skype, you can get it doing something really useful, such as the routine maintenance OS X is supposed to do in the middle of the night. This one is a particular sticking point for me, because while my MacBook Pro is “always on,” when I’m not using it, it’s closed and asleep for fear that my cats will walk across the keyboard when I’m not looking and accidentally-on-purpose order all of Etsy.

Cocktail is a great app for scheduling those maintenance tasks that will keep your Mac humming like a drowsy bee.

Cocktail is a great app for scheduling those maintenance tasks that will keep your Mac humming like a drowsy bee. Once downloaded and installed, you’ll have to enter an administrator’s password to get it open, because Cocktail just does that much next level stuff.

Click the Pilot tab all the way to the right, and choose Scheduler. Select which scripts you’d like Cocktail to run for you, Daily, Weekly, or Monthly. Those are just the built-in Mac OS X maintenance scripts, but Cocktail also gives you a few more options when setting up automation.

Cocktail will clear selected caches, for either the user logged in or all users. Clicking Options gives you a lot more control over what happens when Cocktail takes a shiv to your various caches, and you can get really specific with your component, user, and Internet caches, letting Cocktail know exactly what’s good to keep and what gets the axe. You can also have Cocktail delete language files you’re not using, or tell Cocktail what to do with your log files during maintenance.

Cocktail will play a completion sound, nice if you have it set to run while you’re cooking or organizing your CDs, less so half an hour before your alarm goes off, though, so use with care. You can also set up Cocktail to shut down, log out, or put your Mac to sleep once it’s finished.

The important thing, though, is scheduling. You can set Cocktail to run your maintenance tasks every day or on a specific day of the week, at any time you want. When combined with the automated startup we discussed in number 1, you’ll have your Mac performing its own planned tuneup when you know you won’t be using it anyway.

3: Prime Your Mac So It’s Ready to Go when You Login

Most people have used Login Items in the past, even if they haven’t realized it. If you’ve installed an app that pops up a menubar item every time you start up, like Dropbox, Cloudapp, or Caffeine, you’re using Login Items. More than that, Login Items are apps that launch whenever you log in. If there are applications you always have running (like Mail or another email app) or apps you want to be the first thing you see when you look at your Mac in the morning (like iCal or task management), Login Items will get these apps rolling automatically for you.

Login Items are apps that launch whenever you log in.

Depending on the applicationss involved, this could significantly slow your login, however, and the more apps you pile on, the more significant the drag. Handle with care, your mileage may vary, and similar cliches are appropriate here.

To access Login Items, get into System Preferences, click Users & Groups, and choose the Login Items pane. There you’ll see a list of every app that launches when you login.

Adding an app is pretty simple. If you want Mail to automatically launch, click the plus (+) sign under the list of apps and navigate to your Applications folder. Choose Mail, and click Add. Once added, if you want to hide the app on login, select the checkbox next to the app in the Login Items list.

If, like me, you’ve added pretty much all of your apps to your Login Items and you realize it’s taking an unreasonably long time for everything to load when you start your Mac up, it’s easy enough to remove the apps from Login Items that seemed like a good idea at the time but are just slowing things down. Just select the app you want to get rid of in the list and click the minus (-) sign. Poof! Gone.

For some ideas on what works in Login Items, email, calendars, and frequently used programs that you’ll turn to immediately are instant winners. I have my email app, a couple of cloud storage apps, Twitter, and a menubar Facebook updater in my Login Items, because those are the apps I’m either going to check right away or will want access to the entire time I’m using my Mac.

4: Schedule Everything Else with Automator and iCal

You can set your Mac up to do just about anything at anytime using Automator and iCal. Automator allows you to automate tasks without knowing anything about programming or scripting. Instead, Automator allows you to set up tasks as a series of actions inside a graphical user interface.

Automator will take care of all of the things we couldn’t do in the earlier steps, like running a specific application at a set time, not just at login. To get started, locate and open Automator in your Applications folder. If you’re not prompted to start a new document, Click New in the File menu, and then select iCal Alarm for your document type. An iCal Alarm allows you to choose whatever Automator actions you need and then schedule them using iCal.

On the left is the list of all the preset actions, and you can choose just one or a combination of several. I’ll run through a couple to give you an idea of what Automator can do with only minimal effort on your part.

First, we’ll set up an iTunes playlist as an alarm, not just an iCal event alarm, but something to wake you up in the morning or to remind you it’s time to exercise. In Automator, find the “Find iTunes Items” action, and drag it to the workflow area on the right. Now you’ll fiddle with some options. The default is to “find tracks where,” but select the “tracks” dropdown and choose “playlists.” Next, in the search field, enter the name of your iTunes playlist. You can run your workflow at this point using the buttons in the top right, but it won’t do much of anything except let you know that your Boyz II Men playlist was found.

Now that Automator can find Motown Philly, it has be able to play it somehow. Locate the “Play iTunes Playlist” action, and drag it to the workflow, beneath the Find action. Now you can run your workflow. iTunes will launch, and your general vicinity will be filled with lush hip-hop doo-wop. This is only half the Automator/iCal love story, but I’m going to pause to talk about how to automate more applications before we move on to scheduling.

If you want an application to open at a specific time, that’s even easier. Find “Launch Application” in the actions list, and drag it to the workflow. You can have as many instances of the “Launch Application» action as you’d like, but remember they’ll run in order.

In the Application drop-down, just choose which application you want to launch. You can schedule all the apps you use to work to pop up at 8:55 AM, so they’re ready for you when you sit down with your cup of Joe, or set your media center apps so they’re waiting for you at 7:25 PM.

Now that we’ve talked about a couple of the ways to set up workflows, you’re ready to schedule. You’ll save your workflow iCal Alarm, causing iCal to launch, and your workflow will appear as an event. Now all you have to do is edit it like any other iCal event. Change the time you’d like it to occur and the date, whether you’d like it to repeat—you probably will after all this trouble—and how often you’d like the alarm to go off.

Wrap Up

These are only a few examples of what you can do with these features. Each of the scheduling tools discussed above can be tailored to whatever you need from your Mac on a given day and is capable of so much more than just automated startup, shutdown, and app launching. Automator’s workflows in particluar are really endlessly customizable and, combined with the other scheduling tools in this tutorial, should keep you automating for days.

Источник

Читайте также:  Как устанавливать deb пакеты linux
Оцените статью