Comment configurer une tâche planifiée (cron job) ?

Cron est une commande utilisée pour programmer des tâches devant être exécutées périodiquement, par exemple: du lundi au vendredi à 18h00. Les tâches cron vous permettent d'automatiser certaines commandes ou scripts sur votre serveur pour effectuer automatiquement des tâches répétitives. Par exemple, vous pourriez créer une tâche cron pour envoyer des courriels tous les 7 jours.

1. Accédez à votre cPanel.
2. Cliquez sur l'icone "Cron Jobs" dans la section "Avancé".
3. Informer les cellules.

    Common Settings - You can use this dropdown list to populate all but the last fields.
    Minute - The minute setting for the cron job.
    Hour - The hour setting for the cron job.
    Day - The day setting for the cron job.
    Month - The month setting for the cron job.
    Weekday - The weekday setting for the cron job.
    Command - The cron job command to execute.

Si vous désirez exécuter un script, la ligne de commande devrait ressembler à celle ci:
/usr/bin/php ~/public_html/cron.php >/dev/null 2>&1

Si vous désirez éviter un chevauchement, vous pouvez vous inspirer de cette formule:
/usr/bin/flock -n ~/public_html/var/locks/sync.lock /usr/bin/php ~/public_html/shell/script.php >/dev/null 2>&1


  • 101 Utilisateurs l'ont trouvée utile
Cette réponse était-elle pertinente ?

Articles connexes

Bash output redirection

There are 3 built-in file descriptors: stdin, stdout and stderr (std=standard).Basic    0/1/2...

Using Index Manager

This tutorial will teach about using the Index Manager. The Index Manager allows you to customize...

Mod PageSpeed

You can install Mod PageSpeed by using following stepswget...

GeoIP

How to get mod_geoip to work on cPanel (Country and City)   mod_geoip allows you to look...

How to create custom error pages

This tutorial will teach how to create custom Error Pages. Create error pages for 404 Not Found...