Page 1 of 4

[ Cron_okm ] Time-based job scheduler

Posted: 14 Apr 2021, 03:33
by outkastm
Image

About : https://github.com/cronie-crond/cronie

Applicable models: x.64 series, ARMv8 series
Applicable TOS4: 4.1.27 or later versions
Applicable TOS5: 5.1.17 or later versions
App download: https://tmnascommunity.eu/download/cron_okm/

Module WebUI for additional settings can be accesses at

TOS4: http(s)://yournasip:port/modules/Cron_okm/www
TOS5: click on Support & Help from app description inside the App Center

How to manully install this app on TerraMaster application store?

About

This module implements a CRON daemon for use by administrators and other modules to periodically run jobs on the NAS. To simplify job management and to be more flexible this module uses a combination of CRON and Anacron to provide different ways to inject jobs.

Cron is a time-based job scheduler in Unix-like computer operating systems. Cron enables users to schedule jobs (commands or shell scripts) to run periodically at certain times or dates. It is commonly used to automate system maintenance or administration, though its general-purpose nature means that it can be used for other purposes

Image

Re: [ Cron_okm ][ 1.5.7.0 ] Time-based job scheduler

Posted: 12 Jul 2021, 08:43
by titanrx8
I have 2 x f2-221. One is only the destination for rsync so only needs to power on when rsync is scheduled to run. The problem I have is that the destination Nas scheduled power on and off doesn't work correctly since update to 4.2.14. could I create a cron job on the primary server to issue a wake on lan command to the rsync server and then after a set time issue a shut down command to the rsync server?

Re: [ Cron_okm ][ 1.5.7.0 ] Time-based job scheduler

Posted: 12 Jul 2021, 20:05
by outkastm
Sure you can. Cronjob can be used to schedule any command/script you want.

For wake on lan, use the command

Code: Select all

[root@TNAS ~]# ether-wake MAC

BusyBox v1.27.2 (2018-04-03 18:05:42 CST) multi-call binary.

Usage: ether-wake [-b] [-i IFACE] [-p aa:bb:cc:dd[:ee:ff]/a.b.c.d] MAC

Send a magic packet to wake up sleeping machines.
MAC must be a station address (00:11:22:33:44:55) or
a hostname with a known 'ethers' entry.

        -b              Broadcast the packet
        -i IFACE        Interface to use (default eth0)
        -p PASSWORD     Append four or six byte PASSWORD to the packet

You can use this guide and adapt it to your needs and commands available on NAS

https://www.cyberciti.biz/faq/how-to-wa ... -in-linux/

Re: [ Cron_okm ][ 1.5.7.0 ] Time-based job scheduler

Posted: 13 Aug 2021, 07:12
by nhenry96
Hi
I've installed the app and shows up on the desktop but when I open the app or go to the URL (~/modules/Cron_okm/www) I just get: "(no access)"

I was logged in with my only user and that is an admin of course, I've tried rebooting and reinstalling but I'm just seeing (no access).

I'm running TOS 4.2.14

Any help would be appreciated.

Cheers
Nick

Re: [ Cron_okm ][ 1.5.7.0 ] Time-based job scheduler

Posted: 14 Aug 2021, 00:54
by outkastm
download again the package and install it

Re: [ Cron_okm ][ 1.5.7.0 ] Time-based job scheduler

Posted: 14 Aug 2021, 01:23
by sports_wook
Downloaded the new package and working properly now - thanks!

Re: [ Cron_okm ][ 1.5.7.0 ] Time-based job scheduler

Posted: 16 Aug 2021, 16:57
by nhenry96
outkastm wrote: 14 Aug 2021, 00:54 download again the package and install it
Great thanks outkastm, that got it

Re: [ Cron_okm ][ 1.5.7.0 ] Time-based job scheduler

Posted: 31 Dec 2021, 14:33
by alvingo
Just want to verify if I want to put this line in there, will it work?

Code: Select all

0 0 * * * * root find ./mnt/md1/Temp -mtime +20 -type f -delete
The command above is to find files older than 20 days and delete it.

Where does this conf file be saved when you apply it.

Sorry for the n00b questions.

Re: [ Cron_okm ][ 1.5.7.0 ] Time-based job scheduler

Posted: 01 Jan 2022, 05:55
by Hardfecx
is there a possibility to get an arm version?

Re: [ Cron_okm ][ 1.5.7.0 ] Time-based job scheduler

Posted: 03 Jan 2022, 05:53
by outkastm
alvingo wrote: 31 Dec 2021, 14:33 Just want to verify if I want to put this line in there, will it work?

Code: Select all

0 0 * * * * root find ./mnt/md1/Temp -mtime +20 -type f -delete
The command above is to find files older than 20 days and delete it.

Where does this conf file be saved when you apply it.

Sorry for the n00b questions.
if you edit the file via WebUI, it is saved in the general config located at /usr/local/Cron_okm/sys/etc/cron.d/0module

The logs can be viewed in the messages file located at /var/log/messages and look for the lines with OKM_CROND

Code: Select all

Jan  2 20:40:01 TNAS-xxxx OKM_CROND[16252]: (www-data) CMD (/usr/local/bin/Nextcloud_okm cron.php)
Jan  2 20:40:06 TNAS-xxxx OKM_CROND[16251]: (www-data) CMDEND (/usr/local/bin/Nextcloud_okm cron.php)