4
votes

Can someone please explain me, what I have to do? I want Magento to clean logs, create a sitemap every day.

Is this the right order:

  1. Setup Cron in Server
  2. Setup Cron in Magento
  3. What will be next step?

How do I do step 1 and 2? What will be step 3? Do I have to wait?

1
There is an entire Stack Exchange site dedicated to magento - magento.stackexchange.com. I think you'll have better luck posting this there :) This post is not really about programming at all. It is more about server maintenance. If not on magento - perhaps Server Fault... but I'd recommend trying on magento.SE first.Lix
"Questions about general computing hardware and software are off-topic for Stack Overflow unless they directly involve tools used primarily for programming."Lix
This question appears to be off-topic because it is about magento.stackexchange.com.Luc M

1 Answers

7
votes

Setting up cron on your server

Use crontab -e to edit your cron jobs. To run a daily cron, add a line like this:

0 3 * * *  /bin/sh /path/to/magento/cron.sh

This will run at 3 AM every night.

For log cleaning, you can check /path/to/magento/shell/log.php.

Set up cron in Magento

In the Magento admin, go to: System > Configuration > Advanced > System > Cron (Scheduled Tasks) and configure cron jobs you wish to run.

You should know that Magento runs cron jobs even if you don't have a daily cron job configured. Whenever Magento receives a request, it checks if there are any cron jobs to be run. Therefore, having the daily cron job would only make sense if you had no requests for an entire day.

Really there is no next step to be done. I recommend you read How to Set Up a Cron Job.