Ver Mensaje Individual
  #2 (permalink)  
Antiguo 07/07/2022, 01:10
Avatar de vb2005
vb2005
 
Fecha de Ingreso: noviembre-2005
Ubicación: Paderborn - Alemania
Mensajes: 568
Antigüedad: 19 años, 3 meses
Puntos: 25
Respuesta: hacer un cron con php con time

Qué es bien lo que quieres hacer explica un poco más.

Crons no dependen de PHP, aqui un ejemplo de como se configuran (extracto de mi /etc/crontab)

Código C:
Ver original
  1. # Example of job definition:
  2. # .---------------- minute (0 - 59)
  3. # |  .------------- hour (0 - 23)
  4. # |  |  .---------- day of month (1 - 31)
  5. # |  |  |  .------- month (1 - 12) OR jan,feb,mar,apr ...
  6. # |  |  |  |  .---- day of week (0 - 6) (Sunday=0 or 7) OR sun,mon,tue,wed,thu,fri,sat
  7. # |  |  |  |  |
  8. # *  *  *  *  * user-name command to be executed
  9. 17 *    * * *   root    cd / && run-parts --report /etc/cron.hourly
  10. 25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
  11. 47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
  12. 52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
  13. #


Para un script php no sería muy diferente el punto de entrada:


Código C:
Ver original
  1. # Laravel Forge Scheduler
  2. * * * * * forge php /home/forge/xxxx/current/artisan schedule:run > /home/forge/.forge/scheduled.log 2>&1
__________________
www.marcher.com.uy - Web personal
Nerd's Corner - Desarrollo de software a medida