PHP 5 Auto Executable Script

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
Farry
Forum Newbie
Posts: 6
Joined: Wed Sep 20, 2006 4:58 am

PHP 5 Auto Executable Script

Post by Farry »

I need some help regarding an automatic executable script. How can i make my script execute automatically without opening a single browser time to time.

I've to update a database transparently with the time period of 1 hr [CSV from remote server and then upload it to database].
Last edited by Farry on Wed Sep 20, 2006 2:01 pm, edited 1 time in total.
User avatar
Weirdan
Moderator
Posts: 5978
Joined: Mon Nov 03, 2003 6:13 pm
Location: Odessa, Ukraine

Post by Weirdan »

Farry
Forum Newbie
Posts: 6
Joined: Wed Sep 20, 2006 4:58 am

Post by Farry »

Thanks Weirdan. Ok my apoligies. Tell me that how can i schedule a .php task into Cron at my Webserver.
Last edited by Farry on Wed Sep 20, 2006 6:58 am, edited 1 time in total.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

:?: cron and ftp are not related.
Farry
Forum Newbie
Posts: 6
Joined: Wed Sep 20, 2006 4:58 am

Post by Farry »

I've scheduled a task but its not working. Can you please tell me the proper way to configure it and how to specify the script [.php] to execute.

Regards.
User avatar
ibbo
Forum Commoner
Posts: 51
Joined: Tue Sep 19, 2006 6:20 am

Post by ibbo »

Heres one of my newsletter cron jobs

30 18 19 * * /usr/bin/perl /home/ibbo/bin/pmail.pl /home/ibbo/bin/sbscribedaa

Explained

30 (mins)
18 (hour)
19 (day)
* (irrelavant but for the month of the year [1-12])
* (irrelavant but for the day of the week [0-6])

You need to use full paths for your jobs to work so

to run a job today (20th) at 7pm

00 19 20 * * /usr/bin/php /path/to/php-script.php

Ibbo
Farry
Forum Newbie
Posts: 6
Joined: Wed Sep 20, 2006 4:58 am

Post by Farry »

I've scussfully upload and scheduled the file into Cron but it says now the <?php, function functionName(), and lots more like this errors so can you tell me how can i execute a PHP file through Cron n what lines should i include into this file to be execute from the Cron. I've Server API is Apache.
Farry
Forum Newbie
Posts: 6
Joined: Wed Sep 20, 2006 4:58 am

Post by Farry »

How can i configure Cron job while using Apache as SERVER API. Where can i get lynx in my admin panel.
User avatar
ibbo
Forum Commoner
Posts: 51
Joined: Tue Sep 19, 2006 6:20 am

Post by ibbo »

By using full paths like I said.

* * * * * /path/to/php /path/to/php-scrip.php
Post Reply