Skip to content

Scheduled tasks

Scheduled tasks run automation on a timer: a command, a snippet, or a workflow. They need Squeezed.

  • On Android they use WorkManager, which fires them on time whether ZestSSH is open or not. Android lets an app start a run by itself only while the app is open, so when ZestSSH is closed or in the background, a task that comes due shows a notification, and it runs when you tap it (see How a task runs).
  • On a computer (from 4.0), ZestSSH runs them itself while it is open or in the tray. A run missed while ZestSSH was closed or locked runs once, as soon as it is open again (see On a computer).
Platform Status
Android Supported, through WorkManager
Windows, macOS and Linux Supported from 4.0, while ZestSSH is open or in the tray
iPhone and iPad Not available. The screen says “Background scheduling isn’t available on iOS”

On an iPhone, the screen says: “iOS does not let an app run tasks in the background on a schedule. A Shortcuts automation can open a zestssh:// link at a set time; ZestSSH then opens and runs it once you confirm on screen.” Such a link asks Run this from a link? every time and waits for Run, so it does not run by itself. See iOS Shortcuts.

  1. Turn on automation:
    • On a computer: open Automation in the sidebar and turn on the Automations on switch at the top right.
    • On a phone: More > Automation, then External automation.
  2. Make an API key: on a computer, the API keys tab of Automation; on a phone, More > Automation > API keys (see API keys). The task names the key, so you do not need to copy it for this. A key works only on the device that made it, so make it on the device that runs the task.
  3. In Keys, open the key each host signs in with and turn on Allow unattended runs. A scheduled task signs in only with keys allowed for unattended runs, the keys of its jump hosts included.
  4. Connect to each host yourself once, so ZestSSH trusts its host key. A task refuses a host key this device does not trust yet.
  1. Open the scheduled tasks:
    • On a computer: open Automation and choose the Schedules tab (from 4.3; before, Runs and then Scheduled tasks). The command palette (Ctrl+Shift+K) has it too: type “Scheduled tasks”.
    • On a phone: More > Automation > Scheduled tasks.
  2. On a computer choose New schedule at the top of the page; on a phone, + (or Create task when you have none).
  3. In New scheduled task, fill in:
    • Task name, for example “Health check”.
    • Action type: Execute command, Run snippet, or Run workflow.
    • Host: the host to run on (not asked for a workflow, whose steps name their own hosts).
    • Command, Snippet or Workflow: what to run. The workflows listed are those of your personal space, the only ones a schedule runs, whichever space is on screen.
    • Schedule: see below.
    • API key: the key the task uses. If you have none yet, the form says so.
  4. Choose Schedule task.

Without Squeezed, the page shows what it gives with made-up tasks, its price, and Restore purchases.

The Schedule has three kinds:

  • Every N minutes: every 15 minutes, 30 minutes, 1 hour (the default), 2 hours, 6 hours, 12 hours, or 24 hours. The first run comes right away, then each run comes that long after the last one. Nothing shorter than 15 minutes is offered, on any device.
  • Daily: once a day at a time you pick. The first run is at the next such time.
  • Weekly: once a week on a day and at a time you pick.

There is no one-time task and no delay to set.

From 4.3 the Schedules tab of Automation is a table, one row per task:

Column What it shows
Schedule The task’s name and what it runs: its command, its snippet (Snippet: and the name) or its workflow (for example “Workflow, 3 steps”)
Runs When, for example “Daily at 09:00”
On The host it runs on. For a workflow, the host or group of its steps, or the first and how many more
Last run When it last ran and how long it took (“took 4 s”), or Not run yet
Next When it runs next. A task already due says Within a minute; one switched off says Off

At the end of each row are Run now, the task’s switch, and a menu with Delete (which asks first). Run now runs the task at once, as its schedule would: after any run under way, never beside it, and with the same checks. A task that is switched off cannot be run now (“Turn this schedule on to run it”). A run counts as the task’s run, so a task that was due is not run again at the next look.

A window too narrow for the columns shows the tasks as cards instead. Before Squeezed, the tab shows what it gives with made-up tasks.

A failed run says why, in red, under its time (“Failed, 09:00”): ZestSSH’s own reason where it refused the run, else the first line of what the run reported, with the ZS code it named, where it named one. Details opens Why Health check failed with everything the run said, its exit status and Copy details (names and secrets taken out). The row’s Run now then reads Try again.

On a phone, from 4.3, each task’s card says which host it runs on (“On web-01”) and, after a failure, why, with Details.

The phone’s Scheduled tasks screen lists every task as a card with its name, its schedule (for example “Daily at 09:00” or “Every Mon at 09:00”) and, once it has run, Last: with how long ago. On a computer’s cards (a narrow window), a task that is on also says when it runs next, for example Next: 09:00, or “Next: within a minute (it was due)” for one whose time came while ZestSSH was closed. The schedule’s words, day names included, follow the app’s language.

  • Pause or resume a task with its switch. Turning it off stops its runs; turning it on schedules it again from now.
  • Delete a task: on a phone, swipe it to the left, then confirm Delete task; on a computer, use Delete in its row’s menu, which asks first.

From 4.0, Windows, macOS and Linux run scheduled tasks themselves. The page says so above the tasks: “Runs while ZestSSH is open or in the tray. A run missed while ZestSSH was closed or locked runs once, as soon as it is open again.”

  • ZestSSH must be running and unlocked. A task runs while ZestSSH’s window is open, minimized or closed to the tray. Quit ZestSSH, or let the app lock lock it, and tasks wait.
  • A missed run runs once. However many runs were missed (overnight with the computer off, for example), the task runs once as soon as it can, and its next run counts from then. A daily or weekly task keeps its time of day after a late run.
  • One run at a time. Tasks due together run one after the other. A run still going is never started a second time.
  • Within a few seconds. ZestSSH looks for tasks that are due every 20 seconds, so a run can start up to that much after its time.
  • A task deleted or turned off while it waits runs nothing.

Its runs go into Automation > Runs, as other automation does. To run a task now, use Run now on the Schedules tab (from 4.3).

  1. The task comes due.
    • On Android, WorkManager fires it. If ZestSSH is open on screen, the run starts at once. If it is not, Android does not let it start by itself, so ZestSSH shows a notification, A scheduled task is ready: “Tap to run it. Android lets ZestSSH start a task by itself only while the app is open.” Tapping it runs the task. The notification is there for up to 12 hours, and a task that fires again replaces its own notification. If ZestSSH may not show notifications, the task does not run. A task deleted or turned off after its notification came runs nothing: ZestSSH says “This scheduled task was deleted or turned off, so it was not run.” With Encrypt data at rest on and ZestSSH locked, the tapped task waits and runs once you unlock ZestSSH.
    • On a computer, ZestSSH starts it itself (see On a computer).
  2. ZestSSH handles it like any other automation request: Squeezed, automation on, the API key there and not expired, then the key’s scope. A workflow that is switched off is not run. While Squeezed or automation is off, a computer’s task waits and runs once when they are back.
  3. ZestSSH signs in to the host as a run with nobody there: only keys allowed for unattended runs, only host keys it already trusts, and no questions answered. Where the server asks for a code, or for a password that is not saved, the run stops and says so. A Telnet host or a remote screen is never run with nobody there, and a key on a security key cannot sign without someone holding it.
  4. The result goes into the automation history (More > Automation > Automation history on a phone, Automation > Runs on a computer), and the task’s Last: shows when it ran.

A task stores the API key’s ID, never the key itself. On Android, WorkManager keeps a task’s data in its own database on the device, and the raw key would be readable there.

When the task runs, ZestSSH checks that a key with that ID is still there and has not expired, and marks it used. The ID is not a secret. On Android it counts only together with a one-time launch token that ZestSSH’s own scheduler writes for each launch, so another app that learned the ID cannot use it. On a computer the run starts inside ZestSSH itself, so nothing outside the app can hand one in.

If you delete the key, the task’s runs are refused. An expired key is refused too, and counts as a failed attempt. ZestSSH cannot show a key again, but a task does not need it: make a new key and a new task with it.

A task records how its command ended:

  • A command counts as done only when the host reports its exit status, or closes the session in order where it reports none.
  • A command still running when its time is up is recorded with everything it printed until then, and the record says that it had not ended.
  • A task that could not sign in or start says why in plain words, for example that the host’s key is not known yet.
  • Android: ZestSSH open, or a tap: a task runs by itself only while ZestSSH is open on screen; otherwise it waits for your tap on its notification.
  • Computer: ZestSSH running and unlocked: nothing runs while ZestSSH is closed or locked; a missed run comes once, later.
  • For work that must run with nobody at the device, a cron job on the server is the dependable way.
  • 15 minutes at the shortest: for anything more frequent, use Tasker with ZestSSH’s intents or a cron job on the server.
  • Timing is approximate: on Android, WorkManager groups work to save battery, so a task can fire late, more so in Doze or battery saver.
  • Each task stands alone: for steps in sequence, schedule a workflow.
  • No editing: a task cannot be changed once made. Delete it and make a new one.
  • Each device its own: a task runs on the device it was made on, with that device’s API key.
  • Use a key of its own for scheduled tasks, with a label such as “Scheduled tasks”, so you can see its use and revoke it alone.
  • If the key has an expiry, plan for it: a task with an expired key stops working, and you make the task again with a new key.
  • Check the automation history now and then to see that your tasks run.