1

Configuring cron with the following lines (using sudo crontab -u daemon -e)

* * * * * bash /path/to/magento/cron.sh --mode default >> /path/to/magento/var/log/cron.log 2>&1
* * * * * bash /path/to/magento/cron.sh --mode always >> /path/to/magento/var/log/cron.log 2>&1

or running the following line from shell

bash /path/to/magento/cron.sh --mode always

gives this error:

Could not open input file: /path/to/magento/--mode

Why does the filename get truncated?

1

If you look at the script cron.sh you will see that it expects two parameters if you want to use a mode: The first parameter is the cron script and the second is the cron mode.

In your case the first parameter is "--mode" and this is used as script in Magento's installation directory - that's why /path/to/magento/--mode is called as script file.

Use the following syntax:

bash /path/to/magento/cron.sh cron.php -mdefault
bash /path/to/magento/cron.sh cron.php -malways

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.