Differenze
Queste sono le differenze tra la revisione selezionata e la versione attuale della pagina.
| Entrambe le parti precedenti la revisioneRevisione precedenteProssima revisione | Revisione precedente | ||
| raspberry_trixie_come_datalogger [2026/06/21 00:21] – [1.9.3 Impostare un IP fisso sul raspberry] walter | raspberry_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 " | ==== 1.8.1 Impostazioni di " | ||
| + | |||
| + | crontab è | ||
| + | < | ||
| + | |||
| + | Ogni u | ||
| + | < | ||
| + | |||
| + | Dato che a noi interessa modificare o gestire job di sistema ci concentreremo sull' | ||
| + | |||
| + | < | ||
| + | sudo -e | ||
| + | cd /.. | ||
| + | crontab -u root -e | ||
| + | |||
| + | </ | ||
| + | |||
| + | 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 ' | ||
| + | # Notice that tasks will be started based on the cron's system\\ | ||
| + | # daemon' | ||
| + | #\\ | ||
| + | # 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 / | ||
| + | #\\ | ||
| + | # 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 * * * / | ||
| + | |||
| + | # al reboot o riavvio del raspberry imposta la velocità della seriale\\ | ||
| + | @reboot stty -F / | ||
| + | |||
| + | </box | ctrl+O per salvare e ctrl+X per uscire> | ||
| Linea 452: | Linea 504: | ||
| - | ==== 1.9.4. Clonazione della SD card ==== | + | ==== 1.8.4. Clonazione della SD card ==== |
| Una cosa molto utile, una volta che il sistema è stabile, è fare una copia della SD per poi poterla ricaricare in caso di malfunzionamento o danneggiamento di quella in uso. | Una cosa molto utile, una volta che il sistema è stabile, è fare una copia della SD per poi poterla ricaricare in caso di malfunzionamento o danneggiamento di quella in uso. | ||
| Linea 475: | Linea 527: | ||
| Continuare dal precedente punto 6. | Continuare dal precedente punto 6. | ||
| - | ==== 1.9.4.1. Clonazione di sd con dimensioni diverse ==== | + | |
| + | ==== 1.8.4.1. Clonazione di sd con dimensioni diverse ==== | ||
| Maggiori informazioni al seguente [[: | Maggiori informazioni al seguente [[: | ||
| - | ==== 1.9.5. Estrazione dei vecchi dati dal' | + | |
| + | ==== 1.8.5. Estrazione dei vecchi dati dal' | ||
| E' possibile interrogare l' | E' possibile interrogare l' | ||
| Linea 515: | Linea 569: | ||
| <wrap indent>< | <wrap indent>< | ||
| - | 20121008 1.118 kWh < | + | 20121008 1.118 kWh < |
| 20121007 0.992 kWh < | 20121007 0.992 kWh < | ||
| </ | </ | ||
| - | ==== 1.9.6. Esecuzione di un backup giornaliero su uno spazio web ftp ==== | + | |
| + | ==== 1.8.6. Esecuzione di un backup giornaliero su uno spazio web ftp ==== | ||
| Nelle guide precedenti veniva eseguito un backup giornaliero e memorizzato in sequenza sul server ftp, questo sistema spreca spazio sul server, è sufficente tenere il backup di qualche giorno. Ho pensato quindi fare un procedura che salvi x giorni e poi scarta il più vecchio con il principio “FIFO” | Nelle guide precedenti veniva eseguito un backup giornaliero e memorizzato in sequenza sul server ftp, questo sistema spreca spazio sul server, è sufficente tenere il backup di qualche giorno. Ho pensato quindi fare un procedura che salvi x giorni e poi scarta il più vecchio con il principio “FIFO” | ||
| Linea 617: | Linea 672: | ||
| e modificare come segue: <box 100% round #ffff99 #d2d2d2 #d2d2d2 #ffff99 | file: root> | e modificare come segue: <box 100% round #ffff99 #d2d2d2 #d2d2d2 #ffff99 | file: root> | ||
| - | SHELL=/ | + | SHELL=/ |
| - | PATH=/ | + | PATH=/ |
| - | # Edit this file to introduce tasks to be run by cron. \\ | + | \\ |
| - | # \\ | + | # 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 \\ | + | # Each task to run has to be defined through a single line\\ |
| - | # and what command to run for the task \\ | + | # 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), \\ | + | # To define the time you can provide concrete values for\\ |
| - | # and day of week (dow) or use ' | + | # minute (m), hour (h), day of month (dom), month (mon),\\ |
| - | # Notice that tasks will be started based on the cron's system \\ | + | # and day of week (dow) or use ' |
| - | # daemon' | + | # Notice that tasks will be started based on the cron's system\\ |
| - | # \\ | + | # daemon' |
| - | # Output of the crontab jobs (including errors) is sent through \\ | + | #\\ |
| - | # email to the user the crontab file belongs to (unless redirected). \\ | + | # 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: \\ | + | # For example, you can run a backup of all your user accounts\\ |
| - | # 0 5 * * 1 tar -zcf / | + | # at 5 a.m every week with:\\ |
| - | # # For more information see the manual pages of crontab(5) and cron(8) \\ | + | # 0 5 * * 1 tar -zcf / |
| - | # \\ | + | # # For more information see the manual pages of crontab(5) and cron(8)\\ |
| + | #\\ | ||
| # m h dom mon dow command | # m h dom mon dow command | ||
| - | 15 21 * * * / | + | 15 21 * * * / |
| </box | ctrl+O per salvare e ctrl+X per uscire> | </box | ctrl+O per salvare e ctrl+X per uscire> | ||
| + | |||
| ====== 2. Connessioni interfaccia USB all' | ====== 2. Connessioni interfaccia USB all' | ||