0

I am weak in server handling I want to know to to set crontab to start cron.sh for my magento website.

when I run command

crontab -l

I get output

no crontab for root

i tried editing /etc/crontab and restarted apache but still it does not works please guide me how to fix it

line I put in etc/crontab is

**5 * * * * root /bin/sh /var/www/mour/cron.sh**
2

credits : @Yorrd

You don't need to execute many commands, the most important thing is that you edit your crontab file. I don't know how this works on Amazon's servers, usually you can do it via crontab -e though (e for edit).

In that file you need to add a new rule which calls the cron.php every so often. The format of this is (borrowed from your link):

* * * * *  /bin/sh /absolute/path/to/magento/cron.sh

Format of this: The first 5 stars stand for minutes, hours, days, weeks and months. Then the shell which you want to run your script (just use /bin/sh) and finally the path to your cron.sh which you need to look up yourself (in your Magento root usually).

We're doing this every minute, because cron.php will take care which scripts to run when and just needs a heartbeat.

or you may contact your hosting providers.

If you successfully add this line as I described above and Amazon didn't disable cron jobs or something, this should work.

| improve this answer | |
  • just need should i use : 5 * * * * /bin/sh /absolute/path/to/magento/cron.sh or */5 * * * * /bin/sh /absolute/path/to/magento/cron.sh – mdeveloper Apr 1 '16 at 6:03
  • Try this : */5 * * * * /bin/sh /absolute/path/to/magento/cron.sh – Baby in Magento Apr 1 '16 at 6:10
2

How often are you trying to run the script?

Try something like this:

*/5 * * * * /bin/sh /var/www/mour/cron.sh

That should execute the cron.sh script every 5 minutes.

| improve this answer | |

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.