4

I try to set up cron to generate my site map.

I defined the google sitemap in catalog > google sitemap. I also defined the system > configuration > catalog > google sitemap generation to every day

I then configured cron in system > configuration > system > cron as follow :

enter image description here

As no update are made on my sitemap files, I implemented the following php php cron job monitor

But no tasks are displayed….

Furthermore, when I do a crontab -l I have i got an error saying "No crontab for user"

Could you help me on that please?

  • Did you run the cron.sh file? – anvanza Aug 18 '14 at 8:45
2

It looks like you need to setup the crontab for the user on your server.

Magento provides some generic instructions on how to do this.

Basically you should add the following lines to your crontab file.

MAILTO=your.user@your.server.com

*/5 * * * *  /bin/sh /path/to/your/magento/cron.sh
  • thanks for your help. If I do /bin/sh I receive the mail but saying : /bin/sh: bin/sh: No such file or directory. If I put just sh, cron is not working any more… In both case, my magento sitemap is not updated – Alexglvr Aug 18 '14 at 15:15
  • @Alexglvr interesting, you could always use the cron.php file and update your cron to something along the lines of */5 * * * * php /path/to/your/magento/cron.php – David Manners Aug 18 '14 at 15:18
  • I managed to run cron properly using the php : */5 * * * * php /path/to/your/magento/cron.php – Alexglvr Aug 24 '14 at 6:03
  • but it does not update my sitemaps (declared in admin panel Catalog > google sitemaps). Their path is magento install dir/sitemap and /sitemapeu: do I have to add something in the cron.php to make them updated? – Alexglvr Aug 24 '14 at 6:09
2

Find out what folder your Magento installation is in via ssh.

'cd' into the magento root folder and type 'pwd' to get the path to the current folder (copy the result).

type 'crontab -e' to create a new crontab file.

paste this into the file:

*/5 * * * *  sh [magento path]/cron.sh

*/5 means the crontab will be executed every 5 minutes.

exit and save the cronjob by typing ':wq'

to email results of cronjob executions write this on the first line of the crontab

MAILTO=[email address]

note however that this will send an email every 5 minutes, so I'd advise to remove this after testing.

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.