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:21] – [1.9.4. Clonazione della SD card] 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>
  
  
Linea 476: Linea 528:
  
  
-==== 1.9.4.1. Clonazione di sd con dimensioni diverse ====+==== 1.8.4.1. Clonazione di sd con dimensioni diverse ====
  
 Maggiori informazioni al seguente [[:clonazione_sd|LINK]] Maggiori informazioni al seguente [[:clonazione_sd|LINK]]
  
-==== 1.9.5. Estrazione dei vecchi dati dal'inverter ====+ 
 +==== 1.8.5. Estrazione dei vecchi dati dal'inverter ====
  
 E' possibile interrogare l'inverter tramite una serie di comandi che potete trovare andando sul sito curtronix.com alla [[http://www.curtronics.com/Solar/screenshots/aurora-Help.html|pagina help in linea]] o interrogando la guida di Aurora con il seguente comando: E' possibile interrogare l'inverter tramite una serie di comandi che potete trovare andando sul sito curtronix.com alla [[http://www.curtronics.com/Solar/screenshots/aurora-Help.html|pagina help in linea]] o interrogando la guida di Aurora con il seguente comando:
Linea 516: Linea 569:
 <wrap indent><wrap indent>energyOld.txt <nowiki> ===></nowiki> energy2012.csv</wrap></wrap> <wrap indent><wrap indent>energyOld.txt <nowiki> ===></nowiki> energy2012.csv</wrap></wrap>
  
-20121008 1.118 kWh <nowiki>===></nowiki>20121008,11.18 \\+20121008 1.118 kWh <nowiki>===></nowiki>20121008,11.18\\
 20121007 0.992 kWh <nowiki>===></nowiki>20121007,9.92 20121007 0.992 kWh <nowiki>===></nowiki>20121007,9.92
  
 </box> </box>
  
-==== 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 618: 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=/bin/bash \\ +SHELL=/bin/bash\\ 
-PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin \\  \\ +PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin\\ 
-# 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 '*' in these fields (for 'any'). \\ +# 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 '*' in these fields (for 'any').\\ 
-# daemon's notion of time and timezones. \\ +# 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). \\ +# 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 /var/backups/home.tgz /home/ \\ +# 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 /var/backups/home.tgz /home/\\ 
-# \\+# # 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 * * * /var/www/MyScripts/ftpbackup.sh \\+15 21 * * * /var/www/MyScripts/ftpbackup.sh\\
 </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'inverter ====== ====== 2. Connessioni interfaccia USB all'inverter ======