- Rename the cron.php si recommended for security reason (it's important to rename if you enable cron on your website so that no one knows and hard to guess, in this tutorial I will use FTP client software to rename it and I will rename it as "myautojobs.php"
- Now after renamed I will edit the file and change the allow job value to enable the cron job
Change the value "0" to "1" to enable the cron
$allow_cron = 0;
$allow_cron = 1;
- Login to your cPanel (This tutorial is using v.11 as I mentioned above, if you are using older version you may see different looks but it should be the same function call)
- Scroll down to "Advanced" section of cPanel (should be last section in the bottom) and click on "Cron Jobs" icon
- Now, you need to set the4 email to receive notifications when the cron jobs are performed it will send the notice to let you know failed or successes, if failed then you can run it manually, and set the cron job schedule to run, in this tutorial I will setup the job to run once a week, I don't want to run it everyday because it may take my bandwidth or slow loading when visitors or members still browsing the website so I will pick the day and time so most likely users don't come online, so I will run on "every week on Sunday at 3 AM"
- This is the setting for every Sunday at 3 AM (weekly run on Sunday only)
- input the command to run the cron job...with example about is for running Autobackup the Database, the cron will automatically connect to your database by access to config files in particular
so that why it recommended that you rename the cron so that nobody knows about it because it could cause security breach we never know, but Safety First, right?
require_once ENGINE_DIR.'/classes/mysql.php';require_once ENGINE_DIR.'/data/dbconfig.php';require_once ENGINE_DIR.'/data/config.php';require_once ENGINE_DIR.'/inc/include/functions.inc.php';
To run Autobackup, simply use command (as on screenshot above)
(since I rename it to myautojobs.php, if you name it something else then use that file instead)
To run cron job on create site map use command:
- If you setup multiple cron jobs I would recommend that you setup jobs to run different time frame because this could cause your server overload if your database size it really big...
After you setup the job to run, you can always edit or modify the settings any time you want by click on "Edit", if you want remove the job you simply remove it
If you run cron job command without parameter, the autobackup will back up the files and save to folder /backup/ so make sure this folder is set CHMODD to "777" (usually you should set it when you first install DLE), and if you specify the max file value, every backup running, it will save to one single file, if you set to 5, then it will run 5 time, after that it will automatically remove the most out date and create the newest one on newest backup ex. the backup #6 will remove the the first backup, the backup #7 will remove the backup #2 and so on...
Sitemap: The cronjob only generate and update the sitemap.xml and save it in the folder /uploads/sitemap.xml it will not submit the sitemap to search engines like google, bing, ask or yahoo, you must manually submit the sitemap by yourself, however, we have provided you the cronjob file to setup auto-submit your sitemap to google, bing, ask and yahoo using Cron Jobs
The cron that set to run autosubmit should be set to run after sitemap generator finished the job..like if you set "myautojobs.php?cronmode=sitemap" to run at 4 AM, the "autosubmit.php" should be set to run after 4 AM, would be perfect to set it to run at 4:30 or 5 AM for example...
You can also run the manually submit your sitemap using single ping command:
Simply replace the "http://www.dlestarter.com/sitemap.xml" with your own URL