FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


how do cron jobs work?





cihan
i have a test file
cronjob.php:
Code:
<?php
$a = "a";
echo "test";
?>

When i set cron job in my DirectAdmin Web Control Panel with this code:
Code:
/usr/bin/php -q /home/cihan/domains/baglantilarim.com/public_html/cronjob.php

an mail comes saying:
Code:
/bin/sh: line 1: /usr/bin/php: No such file or directory

If i use this command:
Code:
/home/cihan/domains/baglantilarim.com/public_html/cronjob.php

this mail comes:
Code:
/home/cihan/domains/baglantilarim.com/public_html/cronjob.php: line 1: ?php: No such
file or directory
/home/cihan/domains/baglantilarim.com/public_html/cronjob.php: line 2: =: command
not found
test
/home/cihan/domains/baglantilarim.com/public_html/cronjob.php: line 4: syntax error
near unexpected token `newline'
/home/cihan/domains/baglantilarim.com/public_html/cronjob.php: line 4: `?>'

If i type this:
Code:
lynx http://www.baglantilarim.com/cronjob.php

the response is this:
Code:

  Your Terminal type is unknown!

  Enter a terminal type: [vt100]
TERMINAL TYPE IS SET TO vt100
(B)0[?7h[?1h=Getting
http://www.baglantilarim.com/cronjob.php
Looking up www.baglantilarim.com                
www.baglantilarim.com           
Unable to locate remote host www.baglantilarim.com.
Alert!: Unable to connect to remote host.          


[?1l>
Looking up www.baglantilarim.com
www.baglantilarim.com
Unable to locate remote host www.baglantilarim.com.
Alert!: Unable to connect to remote host.

lynx: Can't access startfile http://www.baglantilarim.com/cronjob.php


I started to hate cron jobs!!!anybody can help?

Note:cronjob.php's permission is 777, public_html's permission is also 777.
alkutob
I made a search in the forums and noticed that you had some problems with cron jobs since a while ...

I send you this link and I hope it will help , otherwize , you can search google for more informations .

http://www.unixgeeks.org/security/newbie/unix/cron-1.html
cihan
thanks alkutob,
i learned the correct command.(thanks to MrBlueSky)
Code:
/usr/local/bin/php -q /home/cihan/domains/baglantilarim.com/public_html/cronjob.php

the problem was missing /local directory...
Related topics
about cron jobs at directadmin
Cron jobs and PHP?
Enabling Cron Jobs
Has anyone installed Moodle successfully?
FriHost Cron Jobs
Cron Jobs
propos des cron jobs
[RESOLVED] cron jobs
Cron jobs
I don't have cron jobs enabled ?
cron jobs
Cron Jobs
Cron Jobs
Cron Jobs
Reply to topic    Frihost Forum Index -> Support and Web Hosting -> Web Hosting Support

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.