setup cron job on ubuntu server
« on: August 01, 2010, 02:12:07 PM »
I have a Ubuntu testing web server up and am hosting my own site. I have installed sitemap generator and it is working. I would like to create a cron job but not sure how to go about it. I don't have cpanel.

Here is what I have tried. I have created a crontab and issued this cmd to run daily at 2am. It is not working however.
Code: [Select]
00 02 * * * /usr/local/bin/php /var/www/domain/httpdocs/generator/runcrawl.php
I noticed /usr/local/bin doesn't have any files in it.


Re: setup cron job on ubuntu server
« Reply #2 on: August 02, 2010, 08:51:52 AM »
Thank you for your reply.

I've changed the path to /usr/bin/php and did a test run; however, I don't see any changes in google webmaster website.
Looking in the /usr/bin/ directory, there are files in there, but php is not one of them.
Re: setup cron job on ubuntu server
« Reply #3 on: August 02, 2010, 10:20:42 AM »
Further searching about my server, my php uses apache module instead of CGI.  The script maybe a little different now.
The server needs lynx installed and the script changed to this.
Code: [Select]
* * * * * lynx -dump http://www.somedomain.com/cron.php
However, it is still not working for me. Am I going about it the wrong way?
Re: setup cron job on ubuntu server
« Reply #4 on: August 02, 2010, 10:25:06 AM »
In this case you would use something like:
Code: [Select]
lynx -dump http://www.yourdomain.com/generator/index.php?op=crawlprocyou should check if sitemap was created in generator interface though, for google webmaster tools you should submit sitemap manually.
Re: setup cron job on ubuntu server
« Reply #5 on: August 21, 2010, 12:12:43 AM »
I have a weird issue with the cronjob now. It was working fine for the past week. I don't get any cronjob email up until now. However, when I check the generator interface, it looks like it was updated.

The email log doesn't seem to be error. I have attached the log labeled cronjob.txt. I was using this cronjob script
Code: [Select]
00 02 * * * /usr/local/bin/php /var/www/domain/httpdocs/generator/runcrawl.php

In addition, I also tried a different cronjob script to see if I still get an email.
Code: [Select]
lynx -dump http://www.yourdomain.com/generator/index.php?op=crawlproc
With this script, I still get an email. It is not an error, however.
Quote
  Links depth: -
  Current page: -
  Pages added to sitemap: -
  Pages scanned: - (- KB)
  Pages left: - (+ - queued for the next depth level)
  Time passed: -
  Time left: -
  Memory usage: -

   Completed

  Total pages indexed: 31
  Creating sitemaps...

  Creating HTML sitemap...

  Done, redirecting to sitemap view page.

From my understanding about cronjobs, I would only get emails if the cronjobs didn't properly executed. In these cases, it looks like it did. How can I stop my server to not send this particular job if it is possible?