Differenze

Queste sono le differenze tra la revisione selezionata e la versione attuale della pagina.

Link a questa pagina di confronto

Entrambe le parti precedenti la revisioneRevisione precedente
Prossima revisione
Revisione precedente
raspberry_trixie_come_datalogger [2026/06/21 00:22] – [1.9.6. Esecuzione di un backup giornaliero su uno spazio web ftp] walterraspberry_trixie_come_datalogger [2026/06/21 00:46] (versione attuale) – [1.8.1 Impostazioni di "crontab"] walter
Linea 287: Linea 287:
  
 ==== 1.8.1 Impostazioni di "crontab" ==== ==== 1.8.1 Impostazioni di "crontab" ====
 +
 +crontab è
 + <font inherit/inherit;;inherit;;#ffffff>lo strumento utilizzato per pianificare l'esecuzione automatica di script o comandi a intervalli specifici</font>  .
 +
 +Ogni u
 + <font inherit/inherit;;inherit;;#ffffff>tente gestisce le pro</font>  prie pianificazioni privatamente, mentre l'amministratore (root) può configurare anche i job di sistema tramite ''/etc/crontab''
 +
 +Dato che a noi interessa modificare o gestire job di sistema ci concentreremo sull'utente "root", per modificare il crontab di root esecuire i seguenti comandi:
 +
 +<code>
 +sudo -e
 +cd /..
 +crontab -u root -e
 +
 +</code>
 +
 +Si aprirà il file crontab in modifica con il contenuto già presente, noi dobbiamo aggiungere questi comandi:
 +
 +<box 100% round #ffff99 #d2d2d2 #d2d2d2 #ffff99 | file: crontab>\\
 +# Edit this file to introduce tasks to be run by cron.\\
 +#\\
 +# Each task to run has to be defined through a single line\\
 +# indicating with different fields when the task will be run\\
 +# and what command to run for the task\\
 +#\\
 +# To define the time you can provide concrete values for\\
 +# minute (m), hour (h), day of month (dom), month (mon),\\
 +# and day of week (dow) or use '*' in these fields (for 'any').#\\
 +# Notice that tasks will be started based on the cron's system\\
 +# daemon's notion of time and timezones.\\
 +#\\
 +# Output of the crontab jobs (including errors) is sent through\\
 +# email to the user the crontab file belongs to (unless redirected).\\
 +#\\
 +# For example, you can run a backup of all your user accounts\\
 +# at 5 a.m every week with:\\
 +# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/\\
 +#\\
 +# For more information see the manual pages of crontab(5) and cron(8)\\
 +#\\
 +# m h dom mon dow command
 +
 +# imposta un riavvio forzato alle 2:00 di notte\\
 +00 02 * * * sudo shutdoun -r now
 +
 +# imposta il backup dei dati su un server remoto alle 21:15 di ogni giorno\\
 +15 21 * * * /var/www/MyScripts/ftpbackup.sh
 +
 +# al reboot o riavvio del raspberry imposta la velocità della seriale\\
 +@reboot stty -F /dev/ttyUSB0 19200
 +
 +​</box | ctrl+O per salvare e ctrl+X per uscire>