Better run crontab directly on the server. crontab has the following format:
[minutos] [horas] [dias do mês] [mês] [dias da semana] [usuário] [comando]
The completion of each field is done as follows:
Minutes: enter numbers from 0 to 59;
Hours: enter numbers from 0 to 23;
Days of the month: enter numbers from 0 to 31;
Month: enter numbers from 1 to 12;
Days of the week: report numbers from 0 to 7;
User: is the user who will execute the command (it is not necessary to specify it if the user’s own file is used);
Command: the task that must be executed.
To run "my-script.php" every 1 hour do the following:
# crontab -e
00 * * * * /usr/local/bin/php /home/pedrodelfino/meu-script.php
Other examples can be found at the following URL http://pt.wikipedia.org/wiki/Crontab just leave a hint, the path to the PHP file should be absolute, so everything will work fine.
this is for linux? Or it doesn’t depend on the OS. I saw a similar example that was for linux.
– André Nascimento
Yes André, it’s for Linux.
– Renato Tavares
How do I run a @Renatotavares URL? Instead of a specific file?
– Sr. André Baill
@Andrébaill cron runs a command, you can give a wget in the url you want or create a shell script that makes a Curl or wget in the url you want and calls this script in cron.
– Renato Tavares