Securely running cron tasks

By 30th March 2015June 9th, 2017No Comments

The isolation of web server and access server in MageStack provides excellent security for your SSH/FTP (access) environment from that of the web. The automated element that connects the web server, to the access server is the Magento document root, specifically, the Magento cron.

It is not recommended to use the standard Magento, but instead use our secure replacement, follow the [Magento cron configuration][/help/magestack/magento-cron-configuration/] guide for more information.

Running custom tasks

It is common for other cron tasks to be executed independent of the Magento cron. If the files used for these tasks are in the Magento document root, it means that they potentially could be modified from the environment of the web server, and thus affect the access server if not secured.

When executing custom cron tasks, you should execute them via the included wrapper, it can be found here,


There are a number of options that can be supplied to run a cron task, Usage: [domain-group] [method] [script] ([args])

          domain-group   Domain group (eg. example)
          method         Binary to execute (eg. php)
          script         Script path to binary relative to domain-group (eg. /domains/
          args           (Optional) Arguments to pass to script (eg. --reindexall)

Using the wrapper will run the process in the context of the domain-group (ie. the same environment as the web server), this will lead to a more secure, more consistent environment for your processes to run in.


Re Index every X hours

The following will trigger a reindex of all indexes at 5am each day (you can adjust the command/time to suit your requirements).

0 5 * * * /microcloud/scripts_ro/ "example" "php" "/domains/" "--reindexall"