How to Run Scheduled Tasks on ZimaOS (Zima Cron Tutorial)

Zima Cron is a scheduling tool designed specifically for ZimaOS. It allows you to automate tasks such as script execution and data backups without installing extra dependencies. You can install it directly using the built-in package manager.

1. Install Zima Cron

ZimaOS includes the official package manager zpkg, so no additional configuration is required.

  1. Open the ZimaOS terminal
    (via the Web management interface or by logging into the device directly).

  2. Run the following command:

zpkg install zima_cron

After installation, no system reboot is required.
Zima Cron will automatically appear in the Apps list in ZimaOS.


2. Open Zima Cron

In the ZimaOS Web management interface, click to open Zima Cron.


3.Create a Scheduled Task (Test Example)

Follow the on-screen instructions to create your task.

Below is a safe, risk-free test task to verify that Zima Cron is working correctly.
This task records the current system time to a log file every minute.

3.1 Steps:

  1. In the Zima Cron main interface, click New Task in the top-right corner.

  2. Fill in the task information as follows:test-log

  3. Command:
    Copy and paste the following command:

  4. bash -c 'echo "$(date "+%Y-%m-%d %H:%M:%S") zima cron works" >> /DATA/zima_cron_test.log'

  5. Schedule Type: Select Interval (minutes)

  6. Interval: 1(Runs once every minute)

  7. Click Create to activate the task.

3.2 Cron Expression Scheduling (Advanced)

In addition to Interval (minutes) scheduling, Zima Cron also supports Cron Expression scheduling.

When creating a task, switch Schedule Type to Cron Expression and enter a valid cron expression.

For example:

*/5 * * * *

Runs the task every 5 minutes.

This allows precise scheduling, such as:

  • Running at a fixed time every day

  • Running on specific days of the week

  • Running monthly at a specified time

3.3 Verify Task Execution

To verify whether a scheduled task is running correctly:

  1. Open Zima Cron

  2. Click Show Logs next to the task

If the logs continuously show success, the task is running as expected.
You can also confirm task status directly in the task list.


4. Summary

Once you understand how to use Zima Cron, you can easily create scheduled tasks for:

  • Data backups

  • Automatic script execution

  • Routine maintenance jobs

This helps reduce repetitive manual work and improves efficiency when using ZimaOS.

Now you’re ready to create and manage your own scheduled tasks!

Appendix

GitHub Repository:
https://github.com/LinkLeong/zima_cron/releases

5 Likes

This is great. Kindly further explain how to use it to manage installed apps (eg. If I need to schedule restarting HomeAssistant daily at 4 am, how can I use this feature?)

Excellent utility, however, the tasks are deleted upon restarting. ZimaOS v1.5.3

1 Like

Let me have a check, thanks for remind me.

2 Likes

This is fantastic, thank you! I think many of us would love to see it containerized and distributed via the Zima App Store, perhaps with some form of logging ability backed by SQLite.

2 Likes

Very cool, I have trying to find information about ZimaOS and CRON the last 2 days. Glad I found this on the forum. This NEEDS to be on your Documents page now. This is a big deal that many don’t know about.

And perhaps you should actually add this as a simple checkbox in settings / developer mode. :white_check_mark: Add Zima Cron Scheduler to the Dashboard

1 Like

This is still the case - a reboot clears any saved tasks. This makes it kind of, y’know, less useful…? I hope you can fix this, it would be awesome!

Also, where are the logs kept? My script ran successfully but still showed “signal: kiilled” in the zima_cron UI so I was trying to find out why it showed that way, but there’s no long in /var/logs or anywhere else I can find.

1 Like

I might be missing something…but why would you not add this somewhere users can logically find it? In settings or in the app store. somewhere we’d look for it rather than a random post on your forums.