2

I have connected my store with SSH terminal and then I navigated to the root directory of my store where I run the following command

*/5 * * * * cron.sh

But its showing this error: bash: */5: No such file or directory

1

What you've written isn't a command that you can enter in the shell - it's a crontab entry that should go in a special file, which you can edit using crontab -e (user crontab) or sudo crontab -e (root crontab)

View crontab

To output/view the crontab of the current user

crontab -l

To view the crontab of another user you would need sudo permissions

sudo crontab -l -u nameOfOtherUser

Edit crontab

crontab -e

The possible cron line using full path to php

*/5 * * * * /usr/bin/php /var/www/html/sitename/cron.php

or for debugging purposes

*/5 * * * * /usr/bin/php  -q /var/www/html/sitename/cron.php > /var/www/html/sitename/cron-error.log 2>&1
  • Cron.sh file is located in the root directory of my store and I navigated to the root directory of my store using SSH terminal, now which command I have to run? – Syed Muneeb Ul Hasan May 27 '17 at 10:03
  • in terminal check your root dir path for eg. pwd (present working directory) from ssh. what you get ? – Priyank May 27 '17 at 10:05
  • It's showing the directory path /home/master/applications/tswguhztub/public_html – Syed Muneeb Ul Hasan May 27 '17 at 10:08
  • try entering /home/master/applications/tswguhztub/public_html/cron.sh and check – Priyank May 27 '17 at 10:09
  • still the same result – Syed Muneeb Ul Hasan May 27 '17 at 10:15
0

Take a break and restore any changes you've made to your cron.sh file and crontab. There is an easy and breezy way to setup Cron on your Magento store. I do this for every store I setup and it always work.

  1. Disable Magento Compiler by running this code at your Magento root directory:
php -f shell/compiler.php disable
  1. Log into Admin Panel and disable all your cache:
System > Cache Management > (Select All) > Actions: Disable > Submit

Then log out of Admin Panel.

  1. Install AOE Scheduler from Magento Connect from this link: https://www.magentocommerce.com/magento-connect/aoe-scheduler.html

  2. After installation, run Magento compiler:

php -f shell/compiler.php enable

php -f shell/compiler.php compile
  1. Log into Magento Admin Panel and re-enable all cache.
  2. Then follow the instruction to set up Magento Cron:
System > Scheduler > Instructions

Make sure you enable all recommended options.

  1. After 5 minutes, Go to System > Scheduler > Timeline View to monitor your cron jobs.

If everything went well, you will see:

Scheduler is working. (Last heart beat: x minute(s) ago)

Now Magento cron is functioning well. And all your newsletters, backups, transactional email jobs will execute according to the setting at:

System > Scheduler > Job Configurations

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.