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


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

Articles connexes

How To Install and Uninstall FrontPage Extensions

This tutorial will show you how to install and uninstall FrontPage extensions. Please note that...

How to create custom error pages

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

Comment Configurer une Tâche Cron via CPanel

Ce tutoriel vous montrera comment facilement creer un tâche cron via cPanel. Vous pouvez définir...

Mod PageSpeed

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

Bash output redirection

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