# Astuces Cron

Vérifier la crontab système :

```bash
cat /etc/crontab
```

Lister les crontab de tous les utilisateurs

```bash
for user in $(cut -f1 -d: /etc/passwd); do echo $user; crontab -u $user -l; done
```

Lister les crontab d'un user spécifique

```bash
crontab -l -u "user"
```

<span style="color: rgb(230, 126, 35);"><span style="color: rgb(45, 194, 107);">CRONTAB</span>  
<span style="color: rgb(45, 194, 107);">mm hh jj MMM JJJ tâche</span>  
</span>\# Example of job definition:  
\# .---------------- minute (0 - 59)  
\# | .------------- hour (0 - 23)  
\# | | .---------- day of month (1 - 31)  
\# | | | .------- month (1 - 12) OR jan,feb,mar,apr ...  
\# | | | | .---- day of week (0 - 6) (Sunday=0, Monday=1, and so on)  
\# | | | | |  
\# \* \* \* \* \* user-name command-to-be-executed<span style="color: rgb(230, 126, 35);">  
</span>

crontab -l  
ls -al /etc/cron.\*  
cat /etc/cron.d/\* | grep "votre recherche"

Valider la planification avec crontab guru :   
[https://crontab.guru](https://crontab.guru)

Aide à la création de la cron:  
[https://crontab-generator.org/](https://crontab-generator.org/)