Running the Scheduled Task Manager

Zenario has the ability to run scheduled tasks, triggered by the Linux cron program, but managed in Zenario.

After a new install, Zenario's Scheduled Task Manager (STM) will be disabled:

STM disabled.png

Go to the Modules panel, find the module and start it:

STM being started

With it started, it will be running but with the master switch off:

STM master switch off.png

You should look in the "Setup crontab" drop-down, and copy the code for crontab.

In your Linux server, become the siteadmin user (or whichever Linux user owns the sites), and then edit that user's crontab:

crontab -e

and append the line to the end of the file, which will look similar to:

* * * * * php /var/www/clients/zenariosite/public_html/zenario/modules/zenario_scheduled_task_manager/cron/run_every_minute.php 1

Essentially, this calls the Scheduled Task Manager once every minute, to check if there is something to do.

After saving the crontab, you will need to wait until the next "whole" minute, until STM has been called and knows that cron is call it. In Zenario again, enable the master switch:

STM enable master switch.png

You may need to click the refresh button, but you should now see the master switch is on, and it's being called by cron:

STM master switch on.png

You can then edit each task to determine when it runs (most in-built scheduled tasks suggest the times automatically), and how you'd like the jobs to report activity. Every job writes a log, and you can inspect the log:

STM view log

In-built scheduled tasks

Zenario comes with several in-built tasks, but other custom tasks can be written.

Data Protection Cleanup

The Data Protection panel in Zenario determines when personal data should be deleted from the database, so that data is not stored longer than is necessary. For example, data from form submissions may be deleted after 7 days.

The task jobDataProtectionCleanup follows those rules and deletes data as required.

Publish Content

The jobPublishContent allows you to schedule content items to be published at a date and time in the future.

For example, if you want to publish a news article at 7am tomorrow, or multiple HTML pages at the same time, you can click "Publish" on each content item and if if jobPublishContent is enabled you will see choices about when to publish.

Remove Inactive Pending Users

The task jobRemoveInactivePendingUsers is intended for sites that have an extranet. When users register for an account their email address is normally verified (depending on the Register plugin settings), and their accounts are held in the Pending state in the mean time.

This task causes user accounts to be deleted, if a user (which may be a spammer) registers but does not verify their email address within a given number of days.

Report Errors

Zenario can maintain a log of 404 (not found) requests, where a client browser has requested a Zenario alias that does not exist.

The task jobReportErrors can send a nightly email to an administrator, recording the 404s seen in the past day. 

(The full log is available in Organizer, Configuration->Site settings->Error log.)

Clean Directories

The task jobCleanDirectories deletes old files from Zenario's cache folder.

This marginally improves performance. Without the scheduled task, Zenario's check for cached files that need to be deleted runs on every page load.