-
Tache cron cgi php...
Bonjour,
Tout d'abord, je ne connais rien au perl.
Mais, j'ai besoin de créer une tache cron pour aller chaque jour à heure fixe lancer un fichier php qui va télécharger un fichier txt sur la base...
Après quelques heures de recherches, je pense avoir compris que cette manipulation est possible par l'intermédiaire d'un fichier cgi placé dans le dossier: cgi-bin placé sur mon serveur.
Mais je n'arrive nul par à toruver un exemple de ce qu'il faut mettre comme code dans ce fichier, ni même l'extension que doit porter ce fichier.
Par ailleurs, il n'existe pas de module tout prêt pour ce genre de chose chez mon hébergeur, mais j'ai bien accès à un dossier cgi-bin...
Merci beaucoup pour votre aide :)
-
Reponse au cas ou ...
Fake Cron Setup Instructions
===============================
by SmartCGIs.com
1. Open cron.cgi, set the path to perl.
2. Open cronentries.txt and put in each CGI that should be run, the format is:
Minute Hour Day Month Weekday URL_to_CGI
Seperated by spaces. If you have spaces in your URL replace them with + signs.
Component Acceptable Range
========= ================
Minute of the Hour 0-59
Hour of the Day 0-23
Day of the Month 1-31
Month of the Year 1-12
Day of the Week 0-6
Examples:
0 * * * * http://www.domain.com/script.cgi
That would run once every hour.
0 15 * * 0 http://www.domain.com/script.cgi
That would run at 3 PM (15 european time) every Monday.
0 6,12,18 * * * http://www.domain.com/script.cgi
That would run at 6 AM, Noon, and 6 PM every day.
Note: This version of Fake Cron does not support any additional features that real cron does.
3. Upload all your files in ASCII mode.
4. Set the file permissions of cron.cgi to CHMOD 755.
5. Set the file permissions of your text (.txt) files to CHMOD 777.
6. Create a directory called "logs" in the directory this CGI is in, it will hold the log files.
Set the file permissions of this directory to CHMOD 777.
7. Load cron.cgi in an image tag on the busiest page of your site, like this:
<img src="http://www.domain.com/cgi-bin/cron.cgi" alt="We use scripts by SmartCGIs.com!">
8. You are done. You can check the logs created by the script to see if it's working.
------------------
Feel free to give this CGI to anyone you know.
webmaster@smartcgis.com
Thanks
-
Tu peux également utiliser webcron, c'est un site qui propose exactement ce service, et pas besoin de coder une ligne.