Flow/Configure cronjobs

From Aimeos documentation

Other languages:
English 100%

2018.x+ version

Aimeos jobs are implemented for maintenance tasks like clean up or sending e-mails. Some of them need to be executed very often, others only once a day.


A job should be executed by a regularly running cronjob. You can also execute jobs by hand at any time but some jobs need to run very often, e.g. every minute. Aimeos jobs can be executed on the command line using the Flow command infrastructure:

  1. FLOW_REWRITEURLS=1 ./flow aimeos:jobs "<jobs>" "<sites>"
jobs (mandatory) 
The jobs parameter can be the name of a single job or a list of job names separated by a white space. These jobs are available:
  • admin/cache (remove old cache entries)
  • admin/log (remove old log entries)
  • catalog/import/csv (import categories from CSV files)
  • customer/email/account (create new customer accounts and send e-mails)
  • customer/email/watch (customer notification e-mails on product updates)
  • index/optimize (optimize the product index for fastest access)
  • index/rebuild (rebuilds the product index)
  • media/scale (rescales the product images to the new sizes)
  • order/cleanup/unfinished (removes unfinished orders)
  • order/cleanup/unpaid (removes unpaid orders)
  • order/email/delivery (order delivery related e-mails)
  • order/email/payment (order payment related e-mails)
  • order/email/voucher (e-mails containing the voucher code)
  • order/export/csv (export orders in admin interface)
  • order/service/async (batch update of payment/delivery status)
  • order/service/delivery (process order delivery services like sending orders to ERP systems)
  • order/service/payment (capture authorized payments)
  • product/bought (automatically generated product suggestions)
  • product/export (export products)
  • product/export/sitemap (generate product sitemaps for search engines)
  • product/import/csv (import products from CSV files)
  • subscription/export/csv (export subscriptions in admin interface)
  • subscription/process/begin (start subscription period and add permissions if applicable)
  • subscription/process/renew (renew subscriptions on next date)
  • subscription/process/end (finish subscription period and revoke permissions if applicable)
sites (standard is "default") 
This must be one or more locale site codes that you have used in the administration interface. Several sites must be separated by a white space.


For some jobs (especially the tasks that are sending e-mails) a few configuration settings are required in the "Aimeos" section of the Configuration/Settings.yml file of your application. This includes the e-mail address of your shop, the name displayed in the "From:" line of all sent e-mails and the base URL to the product images:

  1. Neos:
  2.   Flow:
  3.     http:
  4.       baseUri: 'https://yourdomain.com/'
  6. Aimeos:
  7.   Shop:
  8.     client:
  9.       html:
  10.         email:
  11.           from-email: 'me@myshop.com'
  12.           from-name: 'My Shop'
  13.         common:
  14.           content:
  15.             baseurl: 'https://yourdomain.com/Uploads'
  16.           template:
  17.             baseurl: "%FLOW_PATH_WEB%_Resources/Static/Packages/Aimeos.Shop/themes/elegance"

To use another theme CSS for the sent e-mails, you can set the client/html/common/template/baseurl parameter like shown above. As the job controller is executed via a cronjob, you must configure an absolute path to the theme files. The easiest way is to use the "%FLOW_PATH_WEB%" variable which always points to the ./Web/ directory of your Flow application.


Every minute

Some Aimeos jobs should run very often, like the job for sending order confirmation e-mails after an order was placed successfully. This task can also be used for other jobs that should also run frequently:

  • Order CSV export (export of orders marked in the admin interface)
  • Order delivery related e-mails (customer notification e-mails on delivery status changes)
  • Order payment related e-mails (customer notification e-mails on payment status changes and order confirmation e-mails)
  • Order voucher e-mails (e-mails to customers containing the code for the voucher they bought)
  • Process order delivery services (send paid orders to ERP systems or logistic partners)
  • Subscription CSV export (export of subscriptions marked in the admin interface)
  • Customer account e-mails (create new customer accounts and send e-mails with password)
* * * * * php /path/to/flow aimeos:jobs "order/export/csv order/email/delivery order/email/payment order/email/voucher order/service/delivery subscription/export/csv customer/email/account"

Every hour

The same must be done for jobs that have to be executed every hour (or at least several times a day):

  • Product notification e-mails (customer notification for price and stock updates)
  • Removes unfinished orders (unblock product stock and coupon codes)
  • Batch update of payment/delivery status (asynchronous updates via uploaded files)
  • Capture authorized payments (if payments are first authorized and captured later)
30 * * * * php /path/to/flow aimeos:jobs "customer/email/watch order/cleanup/unfinished order/service/async order/service/payment"

Once a day

These jobs should be executed once a day (best at times of low traffic):

  • Cache cleanup (remove old cache entries)
  • Catalog import (import categories from CSV files)
  • Log cleanup (remove old log entries)
  • Removes unpaid orders (delete orders without payment)
  • Product import (import products from CSV files)
  • Products bought together (automatically generated product suggestions)
  • Index rebuild (re-create the product index)
  • Index optimize (optimizes the index for fastest query execution)
  • Product sitemap (generate product sitemaps for search engines)
  • Start subscription period (start subscription period and add permissions if applicable)
  • Renew subscriptions (renew subscriptions on next date)
  • End subscription period (finish subscriptions and revoke permissions if applicable)
0 1 * * * php /path/to/flow aimeos:jobs "admin/cache admin/log catalog/import/csv order/cleanup/unpaid product/import/csv product/bought index/rebuild index/optimize product/export/sitemap subscription/process/begin subscription/process/renew subscription/process/end"

<< Previous: Test the installation | Next: Clear caches, execute jobs and setup the database >>