Customizing CRON jobs

I’m using Dragonfish and I don’t know how to manually enter the cron code. I would like to schedule a long SMART test for every other Sunday, beginning a week from Sunday. How do I do that or at least schedule a task for every other Sunday?
Thanks

can’t you just create a new periodic smart test with a custom timeframe?

You don’t in cron[1]–it just doesn’t allow for such schedules, at least not directly. You can run every 14 or 15 days, but that will always start on the first of the month.

Alternatively, you could run a script every Sunday, and have that script handle the “every other Sunday” part of your objective.


  1. and SMART tests aren’t, or shouldn’t be, scheduled via cron, but smartd has the same limitation ↩︎

This one will run on the first and the 15 th of every month, at 2 AM.

1 Like

Thank You. I guess there’s no way of setting it bi-weekly on a certain day of the week, or modifying the CRON code manually?

I guess I’m asking because in the CRON documentations there are modifiers there are modifiers that the GUI doesn’t except. For example the code for every other Sunday would be

        • 0/14 Is there no way of entering it manually?

Why is it so important to have it on the same day?

Because I need to have my NAS fully operational during the week, so SMART tests and scrubbing need to happen on the weekends, while also not running at the same time. Hence the need to fix a specific day of the week, bi-weekly or even monthly.

You know that SMART tests and scrubs don’t take down the server, right?

But regardless, my answer above stands: there’s no way in TrueNAS cron jobs to specify “every other Saturday” or any such thing. The closest you could come would be to call a script every Saturday (which cron can do), and have that script handle the “every other Saturday” thing.

I do, but I need to plan performance availability.

Yup, a script seems to be the only 100% solution right now. The Threshold Days-option for scrubbing is also a great way to get at least scrubs running on specific week-days. If that option also was available for cron jobs, that would help immensely.