1. Setup Cronjob/Crontab in DLE

Setup Cronjob/Crontab in DLE

  |   28
Setup Cronjob/Crontab in DLEThis tutorial I will show you step by step how to setup Cronjob/Crontab for Datalife Engine using cPanel v11, I would like to thank you our good friend http://neez.net to allow me to use their cPanel to make this tutorial because dlestarter.com is hosting under 50Webs.com and 50webs don't use cPanel, but as I see that a lot of people are using cPanel so I decided to use cPanel to do this tutorial, if anyone using different control panel and want me to add it to the tutorial, I would love to do that to make the example and I will give your website in this tutorial for credit
  1. 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"
    Setup Cronjob/Crontab in DLE
    Setup Cronjob/Crontab in DLE
  2. Now after renamed I will edit the file and change the allow job value to enable the cron job
    Find:
    $allow_cron = 0;
    Change the value "0" to "1" to enable the cron
    $allow_cron = 1;
    Setup Cronjob/Crontab in DLE
    Setup Cronjob/Crontab in DLE
    Save the file to the server and now your cronjob is enable, so next we will setup the command to run the cronjob
  3. 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)
  4. Scroll down to "Advanced" section of cPanel (should be last section in the bottom) and click on "Cron Jobs" icon
    Setup Cronjob/Crontab in DLE
  5. 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"
    Setup Cronjob/Crontab in DLE
  6. This is the setting for every Sunday at 3 AM (weekly run on Sunday only)
    Setup Cronjob/Crontab in DLE
  7. 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
    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';
    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?
    To run Autobackup, simply use command (as on screenshot above)
    myautojobs.php
    (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:
    myautojobs.php?cronmode=sitemap
    Setup Cronjob/Crontab in DLE
    [/center] To run cron job on system optimize (optimize and cleanup some out date contents) (I personally don't re3commend this to run in cron because this could cause your data lost like outdate posts or comments or PM message could be deleted too) use command:
    myautojobs.php?cronmode=optimize
    Setup Cronjob/Crontab in DLE
    To run cron on antivirus (Check suspicious files on your server)
    myautojobs.php?cronmode=antivirus
    Setup Cronjob/Crontab in DLE
  8. 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...
    Setup Cronjob/Crontab in DLE

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

Information!You must register before you can view this text. Please register or Login

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:

http://www.sitemapwriter.com/notify.php?crawler=all&url=http://www.dlestarter.com/sitemap.xml
Simply replace the "http://www.dlestarter.com/sitemap.xml" with your own URL

Dear visitor, you are browsing our website as Guest.
We strongly recommend you to register and login to view hidden contents.

Details

+12

Comments 28

newchap
newchap
V.I.P.
Commented By newchap on February 10, 2012 (5:33 pm)
how do it know if my site have "mod_rewrite"

Thank you bro.
1 61Forum topics : 6Forum replies : 34Forum likes : 0
sawanbanna
sawanbanna
DLE TEAM
Commented By sawanbanna on February 11, 2012 (10:27 am)
If you have already installed DLE then simply set "Enable SEO function:" in DLE admin CP > System Settings and make sure you have .htaccess file in your root directory, then go to your frontpage then click on any short news articles...you will know that you have it enable, if your server don't have enable then you might get 500 internal error or page not found error in your site...

But if you don't have DLE install on your server, then there are several ways to check if its working, I will try to show you the easiest way- Create a .htaccess file (a text file named .htaccess) with the following code in it
Options +FollowSymLinks
RewriteEngine On
Save the file to a subdirectory of your main site something like this
/rewrite-testfolder/.htaccess

Now attempt to browse to the subdirectory (http://yoursite.com/rewrite-testfolder/). One of two things could happen:
- No errors Congrats mod_rewrite engine is now enabled.
- 500, Internal Server Error If you get this message then mod_rewrite was not installed/enabled on your server.
31 409Forum topics : 23Forum replies : 979Forum likes : 150

« Live as if you were to die tomorrow. Learn as if you were to live forever! »
newchap
newchap
V.I.P.
Commented By newchap on February 11, 2012 (12:43 pm)
sawanbanna,
thank you i didn't get any internal server error, that means i have "mod_rewrite" enabled on my server..

regarding corn tutorial by i386, i follow all the steps but i get email saying

/bin/sh: /home/admin/idownlo/myautojobs.php?cronmode=sitemap: No such file or directory


i'am on Kloxo + Webmin (2 free panels) but the tutorial done by cpanel but he mention that other panels work the same way. kindly help me i need to fix this corn job

many thanks again
1 61Forum topics : 6Forum replies : 34Forum likes : 0
sawanbanna
sawanbanna
DLE TEAM
Commented By sawanbanna on February 11, 2012 (1:50 pm)
I am not familiar with Webmin, but my guess about the command, it should look like this:
usr/bin/php -q /home/idownlo/public_html/myautojobs.php?cronmode=sitemap
OR
/var/www/html/mysite.com/myautojobs.php?cronmode=sitemap

It's depending on your folder name and server configuration...if it still not work, then try to add hashbang on top of myautojobs.php so the server knows where to find PHP to precess the script
#!/usr/bin/php -q
31 409Forum topics : 23Forum replies : 979Forum likes : 150

« Live as if you were to die tomorrow. Learn as if you were to live forever! »
newchap
newchap
V.I.P.
Commented By newchap on February 13, 2012 (4:25 pm)
sawanbanna,
i'm sorry but i cannot understand you properly... please check this image. this is from my root access
http://i44.tinypic.com/552f0j.jpg

i hope you can figure it out how i should put the command to server to find corn.php

Thank you
1 61Forum topics : 6Forum replies : 34Forum likes : 0
spamhater
spamhater
DLE TEAM
Commented By spamhater on February 13, 2012 (4:55 pm)
newchap,
your path should look like this
usr/bin/php -q /home/admin/idownlo//myautojobs.php?cronmode=sitemap
sawanbanna does understand you but he wasn't sure the correct path since you got "No such file or directory" I would answer the same...
24 386Forum topics : 12Forum replies : 950Forum likes : 130

Love is a symbol of eternity. It wipes out all sense of time, destroying all memory of a beginning and all fear of an end!
Great achievement is usually born of great sacrifice, and is never the result of selfishness...Without continual growth and progress, such words as improvement, achievement, and success have no meaning.
newchap
newchap
V.I.P.
Commented By newchap on February 13, 2012 (6:45 pm)
spamhater,
as you mention before i put #!
#!/home/admin/idownlo//myautojobs.php?cronmode=sitemap


so far i didn't get any email saying "No such file or directory" i guess your fix work if i'm not mistaken

also please check my sitemap, its not showing much details..
http://www.idownloads4u.com/sitemap.xml
1 61Forum topics : 6Forum replies : 34Forum likes : 0
spamhater
spamhater
DLE TEAM
Commented By spamhater on February 14, 2012 (1:37 am)
I am not sure the multiple sitemaps can be generated by DLE cronjob...I could be wrong...
24 386Forum topics : 12Forum replies : 950Forum likes : 130

Love is a symbol of eternity. It wipes out all sense of time, destroying all memory of a beginning and all fear of an end!
Great achievement is usually born of great sacrifice, and is never the result of selfishness...Without continual growth and progress, such words as improvement, achievement, and success have no meaning.
newchap
newchap
V.I.P.
Commented By newchap on February 14, 2012 (6:11 am)
spamhater,
this happens even if im not using corn job... i try to delete to sitemap from uploads and go to my CP and create new one still the same resault, i kw for sure this is not bcuz of corn job this was there before.. sad
1 61Forum topics : 6Forum replies : 34Forum likes : 0
spamhater
spamhater
DLE TEAM
Commented By spamhater on February 14, 2012 (2:10 pm)
really...?

umh that's odd what version of DLE you are using? have you check your server requirements? is there any other issues in your site?
24 386Forum topics : 12Forum replies : 950Forum likes : 130

Love is a symbol of eternity. It wipes out all sense of time, destroying all memory of a beginning and all fear of an end!
Great achievement is usually born of great sacrifice, and is never the result of selfishness...Without continual growth and progress, such words as improvement, achievement, and success have no meaning.
newchap
newchap
V.I.P.
Commented By newchap on February 17, 2012 (7:20 am)
spamhater,
problem solved... when i put 50000 site map get screwed but 45000 it works and show result in the map.. maybe i didn't know what to put n how many news to add.. dance

but i don't see the corn job is working... even if it works how i kw that it generate sitemap.? even i set to backup my database nothing happens.
1 61Forum topics : 6Forum replies : 34Forum likes : 0
sawanbanna
sawanbanna
DLE TEAM
Commented By sawanbanna on February 17, 2012 (7:19 pm)
did you add email to receive the notification when you setup cronjob in your server? that's how you know if the cron was run...

well, for sitemap, that's good trick set 50000 is max for sitemap limit the generator may not work because it assumed that the sitemap is max in limitation...good trick...
31 409Forum topics : 23Forum replies : 979Forum likes : 150

« Live as if you were to die tomorrow. Learn as if you were to live forever! »
newchap
newchap
V.I.P.
Commented By newchap on February 20, 2012 (6:46 am)
sawanbanna,
haha so that means i finally did something by my self... guess i have learn a bit. cheers to your support. drinks on me beer2

this is what i get when run the job manually in webmin... i guess the corn job is working.. if not lemme kw :)
http://i39.tinypic.com/2d8105z.jpg
1 61Forum topics : 6Forum replies : 34Forum likes : 0
Kathryn
Kathryn
V.I.P.
Commented By Kathryn on February 22, 2012 (12:01 am)
Thank you for the helpful tutorial i386 and I hope you return soon .. we all miss you ! recourse
15 47Forum topics : 109Forum replies : 481Forum likes : 6
Rajat
Rajat
Members
Commented By Rajat on May 29, 2012 (12:19 am)
i want to know how to edit the header image in data life engine anybody can help mail me at :-rockingrajatgarg@gmail.com
3 3Forum topics : 12Forum replies : 38Forum likes : 0
spamhater
spamhater
DLE TEAM
Commented By spamhater on May 29, 2012 (12:35 am)
what header image? I don't see how the question related to this topic
24 386Forum topics : 12Forum replies : 950Forum likes : 130

Love is a symbol of eternity. It wipes out all sense of time, destroying all memory of a beginning and all fear of an end!
Great achievement is usually born of great sacrifice, and is never the result of selfishness...Without continual growth and progress, such words as improvement, achievement, and success have no meaning.
kingpc
kingpc
Members
Commented By kingpc on September 11, 2012 (2:42 pm)
I used this command : " /usr/local/bin/php -q /home/telechar/public_html/myautojobs.php?cronmode=sitemap "
I receive this error :
"Could not open input file: /home/telechar/public_html/myautojobs.php?cronmode=sitemap"
what's problem ?
This is my website : http://www.01telecharger.org
N/A 2Forum topics : 0Forum replies : 0Forum likes : 0
noobos
noobos
DLE TEAM
Commented By noobos on September 11, 2012 (10:18 pm)
kingpc,
please read earlier comments
16 302Forum topics : 12Forum replies : 1036Forum likes : 170
kingpc
kingpc
Members
Commented By kingpc on September 12, 2012 (7:08 am)
Quote: noobos
please read earlier comments

I have read all comments but the problem still the same :(
N/A 2Forum topics : 0Forum replies : 0Forum likes : 0
noobos
noobos
DLE TEAM
Commented By noobos on September 12, 2012 (5:02 pm)
that means the path to your file is not found or you have wrong name for the file, you don't have the file name "myautojobs.php" on your server. so read instruction again!
16 302Forum topics : 12Forum replies : 1036Forum likes : 170
jopaulmj
jopaulmj
V.I.P.
Commented By jopaulmj on September 23, 2012 (1:08 am)
There is any better solution
5 26Forum topics : 0Forum replies : 0Forum likes : 0
sawanbanna
sawanbanna
DLE TEAM
Commented By sawanbanna on September 23, 2012 (4:15 am)
the better solution is using third party script or use your control panel system if there is option for it.
31 409Forum topics : 23Forum replies : 979Forum likes : 150

« Live as if you were to die tomorrow. Learn as if you were to live forever! »
engnino
engnino
Members
Commented By engnino on September 26, 2012 (7:48 pm)
when i use command mycron.php?cronmode=sitemap
my webhosting said (Path can not start with "/" and contain alphabet symbols or numbers) what's wrong and what should i do? thanks smile
N/A 1Forum topics : 1Forum replies : 3Forum likes : 0
sawanbanna
sawanbanna
DLE TEAM
Commented By sawanbanna on September 27, 2012 (3:10 am)
every host has their own tutorials how to setup cronjob or crontab, so you have to read or watch those tutorials, different host using different control panel..as far as I know our control panel and cpanel are fine...when you read their tutorials then you will know how to specify the path to cronjob file
31 409Forum topics : 23Forum replies : 979Forum likes : 150

« Live as if you were to die tomorrow. Learn as if you were to live forever! »
Staples
Staples
V.I.P.
Commented By Staples on October 24, 2012 (4:20 pm)
when I use cronjob, I received an email with content:

Status: 404 Not Found
X-Powered-By: PHP/5.3.16
Content-type: text/html

No input file specified
N/A 7Forum topics : 12Forum replies : 31Forum likes : 0
sawanbanna
sawanbanna
DLE TEAM
Commented By sawanbanna on October 25, 2012 (4:51 pm)
Staples,
the error indicated that the path to file and file name is incorrect. or you didn't set any cronjob functions.
31 409Forum topics : 23Forum replies : 979Forum likes : 150

« Live as if you were to die tomorrow. Learn as if you were to live forever! »
newloaded.net
Commented By newloaded.net on July 8, 2013 (7:02 am)
Hello, is there any way to add cron job for publishing RSS news ?
N/A 1Forum topics : 0Forum replies : 0Forum likes : 0
spamhater
spamhater
DLE TEAM
Commented By spamhater on July 8, 2013 (7:21 pm)
Quote: newloaded.net
Hello, is there any way to add cron job for publishing RSS news ?

what kind of publishing/ are you trying to grab content from other websites using RSS to publish them to your site automatically using cronjob?, if that's the case then we are unable to provide you solution for that because this site is restricted on grabber supports...if you own website ,you have to do better than that.
24 386Forum topics : 12Forum replies : 950Forum likes : 130

Love is a symbol of eternity. It wipes out all sense of time, destroying all memory of a beginning and all fear of an end!
Great achievement is usually born of great sacrifice, and is never the result of selfishness...Without continual growth and progress, such words as improvement, achievement, and success have no meaning.
Information!Would you like to leave your comment? Please Login to your account to leave comments. Don't have an account? You can create a free account now.