Search code examples
cronscheduled-taskspimcore

Pimcore scheduling


In Pimcore when I schedule an object to publish, it didn't work. I see that we require to enable cron job in some file. I didn't get complete details on this any where. Is there any step to enable this process? Can we use scheduling as part of workflow?


Solution

  • Yes, that is correct, you need to add the cron job to crontab as described in step 5 here: https://www.pimcore.org/docs/latest/Getting_Started/Installation.html

    You need either a shell access or a control panel like cPanel or Plesk to set this up. The process is different for each operating system, but for most of the Linux distributions it means executing this command as your server user (for Debian/Ubuntu that is www-data, check what the user is for other distributions):

    sudo -u www-data crontab -e
    

    In there you have to add this line (modify the path to your console.php):

    */5 * * * * php /path/to/pimcore/cli/console.php maintenance
    

    As said this is different for every linux distribution, but should be simple enough once you figure out how to setup a cron job.