GNU/Linux >> Linux Esercitazione >  >> Linux

Dove trovare i lavori cron e i loro registri sul tuo server cPanel

Cron(chronos è la parola greca per tempo) i lavori sono attività che vengono eseguite sul server a intervalli di tempo specifici.

I lavori Cron sono archiviati in /var/spool/cron/nome utente File. Per plothost utente, abbiamo:

root@web [/var/spool/cron]# cat plothost
MAILTO="[email protected]"
SHELL="/usr/local/cpanel/bin/jailshell"
* * * * * /plothost/public_html/test.php
root@web [/var/spool/cron]#

Possiamo vedere che l'utente ha un solo lavoro cron:il file test.php verrà eseguito ogni minuto.

In alternativa, puoi utilizzare il crontab comando per elencare i lavori cron per un utente. Il comando è:crontab -u nome utente -l. Per l'utente plothost , abbiamo:

root@web [/var/spool/cron]# crontab -u plothost -l
MAILTO="[email protected]"
SHELL="/usr/local/cpanel/bin/jailshell"
* * * * * /plothost/public_html/test.php
root@web [/var/spool/cron]#

Puoi trovare i registri dei lavori cron in /var/log/cron file.
Per vedere le voci per un utente specifico usa cat cron | grep nome utente . Ad esempio, per plothost utente abbiamo:

root@web [/var/log]# cat cron | grep plothost
May  2 09:07:29 web crontab[8185]: (plothost) LIST (plothost)
May  2 09:08:12 web crontab[8309]: (plothost) LIST (plothost)
May  2 09:08:12 web crontab[8310]: (plothost) REPLACE (plothost)
May  2 09:08:12 web crontab[8313]: (plothost) LIST (plothost)
May  2 09:09:01 web crond[29907]: (plothost) RELOAD (/var/spool/cron/plothost)
May  2 09:09:01 web CROND[8466]: (plothost) CMD (test.php)
May  2 09:10:01 web CROND[8698]: (plothost) CMD (test.php)
May  2 09:11:01 web CROND[8971]: (plothost) CMD (test.php)
root@web [/var/log]#

Se per qualsiasi motivo vuoi riavviare il servizio crond usa:

root@web [~]# service crond restart
Redirecting to /bin/systemctl restart  crond.service
root@web [~]#

Prestare attenzione quando si lavora con i lavori cron. Eseguire un backup prima di modificare un file di lavoro cron.


Linux
  1. Trova i 10 principali indirizzi IP che accedono al tuo server Web Apache

  2. Accesso al tuo Login cPanel

  3. Come trovare l'indirizzo IP condiviso del tuo server nel cPanel

  4. Come faccio a trovare i file e sommare le loro dimensioni?

  5. Dove trovare i file di registro di accesso SSH su centos

Trova l'indirizzo IP del tuo server

Comando Linux crontab per creare e gestire i lavori Cron

Come aggiungere un sito Web in cPanel e WHM su CentOS 6.7

Accesso Privato e Pubblico al Tuo Cloud Server

Come trovare l'indirizzo IP condiviso principale del tuo server in cPanel

Come trovare il nome del tuo server nel cPanel