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

6 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.

3 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

2 Likes

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.

4 Likes

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.

1 Like

Still doesn’t persist on reboot :disappointed_face:

This is still happening on the latest builds, scheduled tasks do not persist after reboot.

That means the cron entries are being stored in a volatile layer instead of under /DATA or another persistent path. As it stands, this makes the scheduler unsuitable for anything critical or automated long-term use.

Also, there’s no clear logging location. The UI sometimes reports signal: killed, but there are no accessible logs under /var/log or elsewhere to diagnose why.

If this feature is intended to be production-ready, it really needs:

  1. Persistent storage under /DATA
  2. Proper log output (file-based, not just UI)
  3. Clear documentation or integration into Settings / Developer Mode
  4. Ideally App Store packaging so users can find it logically

Right now it feels like a great proof-of-concept that just needs persistence wiring.

2 Likes

To fix / implement (in addition to mentions before):

  • How to edit task? There is only Delete and New
  • Next Run is visible, but there is no way to check schedule?
  • Please add other Intervals (Hours / Days). I know, minutes exists, but make it easier.

PS. persistent store is a must - without it is useless.

Agree 100% If they did that it would be fantastic and very useful!

Hice el “zpkg install zima_cron” hace tiempo. Ahora, queria crear una tarea para ejecutar un script SH pero al crear cualquier tarea, incluso la de ejemplo que indica @777-Spider al rellenar los campos y darle crear no hace nada y no crea la tarea.

Cree la tarea correctamente en crontab, pero si reinicio la maquina, la tarea desaparece.

Intente usar /etc/cron.d/ pero ZimaOS al parecer no usa este cron

Al final, como no suelo reiniciar mi NAS, he dejado la tarea en crontab

Una pena que no funcione Scheduler

Controlled Re-Test – Feb 2026 (Clean Install)

I removed the module completely and reinstalled:

zpkg remove zima_cron
zpkg install zima_cron

After reinstall:

  • zima-cron.service is managed by systemd
  • Restart=always is active
  • Backend stays running
  • Tasks execute correctly
  • Tasks persist after reboot

Tested with a 1-minute interval task writing to:

/DATA/zima_cron_test.log

After reboot:

  • Service auto-starts
  • Tasks remain visible in UI
  • Logging continues as expected

On the current build, persistence appears to be working correctly when installed cleanly via zpkg.

However, there are still usability concerns:

  • Logging location is not clearly documented
  • UI error feedback (e.g. signal: killed) lacks detail
  • Discoverability/integration into Settings or App Store could be improved

If others are still experiencing task loss after reboot, it may be helpful to confirm:

  • systemctl status zima-cron
  • Whether the service is active after reboot
  • Whether it was installed via zpkg without manual modifications

From controlled testing, the scheduler backend itself now appears stable.

2 Likes

Muchas gracias. Mi script ya esta corriendo en Zima_cron, ya probare que pasa cuando reinicie.

1 Like

Tras un reinicio, NO se mantienen las tareas y tampoco deja crear tareas nuevas, de nuevo.

  • systemctl status zima-cron

  • â—‹ zima-cron.service - ZimaOS Cron Service
    Loaded: loaded (/usr/lib/systemd/system/zima-cron.service; enabled; preset: enabled)
    Active: inactive (dead)

  • se instalĂł zpkgsin modificaciones manuales

Espero que se solucionen estos problemas, me parece una herramienta necesaria.

1 Like

Thanks for testing and reporting back.

On a clean install (Feb 2026 build), persistence is working correctly when installed strictly via zpkg. Tasks survive reboot and the service auto-starts.

To understand why your system behaves differently, please run the following after a reboot and share the full output.

Check service status:

systemctl status zima-cron

Check recent service logs:

journalctl -u zima-cron --no-pager | tail -n 50

Confirm installation source:

zpkg list | grep zima_cron

Also please let us know:

  • Your exact ZimaOS version
  • Whether it was installed only via zpkg install zima_cron
  • Whether any files were modified manually

If the service is not active after reboot, that would explain both the task loss and the inability to create new tasks.

Also, if possible, could you please post in English so everyone in the community can follow the discussion more easily? It helps avoid misunderstandings and avoids the need for translation. Thank you.

1 Like

Yeah, I’m facing the same issue as @Rafa2600. After rebooting, the tasks disappear.

Running systemctl status zima-cron shows:

â—‹ zima-cron.service - ZimaOS Cron Service
     Loaded: loaded (/usr/lib/systemd/system/zima-cron.service; enabled; preset: enabled)
     Active: inactive (dead)

Running journalctl -u zima-cron --no-pager | tail -n 50 shows:

Feb 25 09:39:20 Elohim zima-cron[3380172]: 2026/02/25 09:39:20 [REQ] GET /zima_cron/tasks/1772023142413830508/logs from 127.0.0.1:40884
Feb 25 09:39:20 Elohim zima-cron[3380172]: 2026/02/25 09:39:20 [RES] GET /zima_cron/tasks/1772023142413830508/logs took 85.022µs
Feb 25 09:39:21 Elohim zima-cron[3380172]: 2026/02/25 09:39:21 [REQ] GET /zima_cron/tasks from 127.0.0.1:40884
Feb 25 09:39:21 Elohim zima-cron[3380172]: 2026/02/25 09:39:21 [RES] GET /zima_cron/tasks took 50.364µs
Feb 25 09:39:22 Elohim zima-cron[3380172]: 2026/02/25 09:39:22 [REQ] GET /zima_cron/tasks/1772023142413830508/logs from 127.0.0.1:40884
Feb 25 09:39:22 Elohim zima-cron[3380172]: 2026/02/25 09:39:22 [RES] GET /zima_cron/tasks/1772023142413830508/logs took 51.799µs
Feb 25 09:39:37 Elohim zima-cron[3380172]: 2026/02/25 09:39:37 [REQ] GET /zima_cron/tasks/1772023142413830508/logs from 127.0.0.1:40884
Feb 25 09:39:37 Elohim zima-cron[3380172]: 2026/02/25 09:39:37 [RES] GET /zima_cron/tasks/1772023142413830508/logs took 133.018µs
Feb 25 09:39:38 Elohim zima-cron[3380172]: 2026/02/25 09:39:38 [REQ] GET /zima_cron/tasks from 127.0.0.1:40884
Feb 25 09:39:38 Elohim zima-cron[3380172]: 2026/02/25 09:39:38 [RES] GET /zima_cron/tasks took 45.659µs
Feb 25 09:39:52 Elohim zima-cron[3380172]: 2026/02/25 09:39:52 [RES] POST /zima_cron/tasks/1772023142413830508/run took 44.829559642s
Feb 25 09:40:01 Elohim zima-cron[3380172]: 2026/02/25 09:40:01 [REQ] GET /zima_cron/tasks/1772023142413830508/logs from 127.0.0.1:40884
Feb 25 09:40:01 Elohim zima-cron[3380172]: 2026/02/25 09:40:01 [RES] GET /zima_cron/tasks/1772023142413830508/logs took 32.627µs
Feb 25 09:40:05 Elohim zima-cron[3380172]: 2026/02/25 09:40:05 [RES] POST /zima_cron/tasks/1772023142413830508/run took 46.525494642s
Feb 25 09:40:38 Elohim zima-cron[3380172]: 2026/02/25 09:40:38 [REQ] GET /zima_cron/tasks/1772023142413830508/logs from 127.0.0.1:40884
Feb 25 09:40:38 Elohim zima-cron[3380172]: 2026/02/25 09:40:38 [RES] GET /zima_cron/tasks/1772023142413830508/logs took 43.275µs
Feb 25 09:40:54 Elohim zima-cron[3380172]: 2026/02/25 09:40:54 [REQ] GET /zima_cron/tasks/1772023142413830508/logs from 127.0.0.1:40884
Feb 25 09:40:54 Elohim zima-cron[3380172]: 2026/02/25 09:40:54 [RES] GET /zima_cron/tasks/1772023142413830508/logs took 47.304µs
Feb 25 09:41:22 Elohim zima-cron[3380172]: 2026/02/25 09:41:22 [REQ] DELETE /zima_cron/tasks/1772023142413830508 from 127.0.0.1:40884
Feb 25 09:41:22 Elohim zima-cron[3380172]: 2026/02/25 09:41:22 [RES] DELETE /zima_cron/tasks/1772023142413830508 took 55.662µs
Feb 25 09:41:22 Elohim zima-cron[3380172]: 2026/02/25 09:41:22 [REQ] GET /zima_cron/tasks from 127.0.0.1:40884
Feb 25 09:41:22 Elohim zima-cron[3380172]: 2026/02/25 09:41:22 [RES] GET /zima_cron/tasks took 69.069µs
Feb 25 09:43:20 Elohim zima-cron[3380172]: 2026/02/25 09:43:20 [REQ] POST /zima_cron/tasks from 127.0.0.1:40884
Feb 25 09:43:20 Elohim zima-cron[3380172]: 2026/02/25 09:43:20 [RES] POST /zima_cron/tasks took 1.215106ms
Feb 25 09:43:20 Elohim zima-cron[3380172]: 2026/02/25 09:43:20 [REQ] GET /zima_cron/tasks from 127.0.0.1:40884
Feb 25 09:43:20 Elohim zima-cron[3380172]: 2026/02/25 09:43:20 [RES] GET /zima_cron/tasks took 144.228µs
Feb 25 09:43:33 Elohim zima-cron[3380172]: 2026/02/25 09:43:33 [REQ] POST /zima_cron/tasks/1772023400713212112/run from 127.0.0.1:40884
Feb 25 09:44:13 Elohim zima-cron[3380172]: 2026/02/25 09:44:13 [RES] POST /zima_cron/tasks/1772023400713212112/run took 39.948751566s
Feb 25 09:44:13 Elohim zima-cron[3380172]: 2026/02/25 09:44:13 [REQ] GET /zima_cron/tasks from 127.0.0.1:40884
Feb 25 09:44:13 Elohim zima-cron[3380172]: 2026/02/25 09:44:13 [RES] GET /zima_cron/tasks took 29.021µs
Feb 25 09:55:31 Elohim zima-cron[3380172]: 2026/02/25 09:55:31 [REQ] GET /zima_cron/tasks from 127.0.0.1:52850
Feb 25 09:55:31 Elohim zima-cron[3380172]: 2026/02/25 09:55:31 [RES] GET /zima_cron/tasks took 139.882µs
Feb 25 09:55:32 Elohim zima-cron[3380172]: 2026/02/25 09:55:32 [REQ] GET /zima_cron/tasks/1772023400713212112/logs from 127.0.0.1:52850
Feb 25 09:55:32 Elohim zima-cron[3380172]: 2026/02/25 09:55:32 [RES] GET /zima_cron/tasks/1772023400713212112/logs took 80.815µs
Feb 25 09:55:47 Elohim systemd[1]: Stopping ZimaOS Cron Service...
Feb 25 09:55:47 Elohim systemd[1]: zima-cron.service: Deactivated successfully.
Feb 25 09:55:47 Elohim systemd[1]: Stopped ZimaOS Cron Service.
Feb 25 09:55:47 Elohim systemd[1]: zima-cron.service: Consumed 3min 32.315s CPU time, 1.5G memory peak.
-- Boot 92627b8eca6c4d6fbb84efa30333e205 --

zpkg list | grep zima_cron shows:

zima_cron

I’m using ZimaOS+v1.5.4 and yes, I installed it with zpkg install zima_cron and I didn’t manually modify any zima_cron files.

EDIT: There is now an issue in the github page

2 Likes

Having same issue here. After reboot tasks disappear and cannot add new tasks without uninstalling Zima Cron and reinstalling. My results for service status, logs, and source are the same as those already posted here.

â—‹ zima-cron.service - ZimaOS Cron Service
Loaded: loaded (/usr/lib/systemd/system/zima-cron.service; enabled; preset: enabled)
Active: inactive (dead)

zpkg list | grep zima_cron
zima_cron

Using ZimaOS+v1.5.4, installed this with zpkg install zima_cron and I didn’t alter any files.

I created a Pull-Request on the provided GitHub page with a fix for data persistence and the service not starting with the system. The zima-cron.service file refers to casaos services which have since been renamed. For the persistence I am using the /DATA/AppData path to store the Task configurations

1 Like