Page 1 of 1

Change logging path to USB drive?

Posted: Wed Oct 11, 2017 5:54 am
by tvbcom
Is it possible to change the path where sensors are logged to an USB drive?
If so where to change this.

Re: Change logging path to USB drive?

Posted: Thu Oct 12, 2017 8:27 pm
by stefangsbb
Yes, in the logFile-field, you can give an absolute path to the file. So if the path to the USB-drive is /dev/sdc, you can for example specify the log file
as: /dev/sdc/logs/loutside.log

Re: Change logging path to USB drive?

Posted: Fri Oct 13, 2017 7:03 am
by tvbcom
In "settings" at "Logfile" I entered: /media/pi/RASPBERRY/loutside.log

My USB drive are mounted with the name "RASPBERRY" at /media/pi/ as above
Is this correct then?: /media/pi/RASPBERRY/loutside.log

I have a termometer which I named the logfile (in the sensor field) "Temp CH1.log", will this be written to my USBdrive or should I in the sensor field enter the path to the logfile: /media/pi/RASPBERRY/Temp CH1.log? if so what does the field "Logfile" in settings do?

This is the eroor I got:
Failed to open log file: /media/pi/RASPBERRY/loutside.log Error:java.io.FileNotFoundException: /media/pi/RASPBERRY/loutside.log (Åtkomst nekas)
17.10.13 10:15:00 ValueItemLoggerFileBased Failed to open log file: /media/pi/RASPBERRY/Temperatur CH1 Error:java.io.FileNotFoundException: /media/pi/RASPBERRY/Temperatur CH1 (Åtkomst nekas)
17.10.13 10:00:06 ValueItemLoggerFileBased Failed to open log file: /media/pi/RASPBERRY/loutside.log Error:java.io.FileNotFoundException: /media/pi/RASPBERRY/loutside.log (Åtkomst nekas)

Re: Change logging path to USB drive?

Posted: Fri Oct 13, 2017 9:22 pm
by stefangsbb
It is the logFile-field in the sensor that should specify the full path to the log file for the sensor. You have to make sure that the user "nethome" has write access to the specified directory, so it can create and update the files there. This seems to be your current problem.

The logFile-field in settings, is to log event statistics for the server.

Re: Change logging path to USB drive?

Posted: Mon Oct 16, 2017 5:42 am
by tvbcom
Thanks for your answer but I have tried that now with no luck.
I made the directory with both owner and group "nethome"
I created a logfile in the above directory and changed the permission to the logfile the same "nethome"

Any other suggestions?
Regards Goran

Re: Change logging path to USB drive?

Posted: Mon Oct 16, 2017 8:08 pm
by stefangsbb
Hmm, strange - could it be that rights are missing on the path there?
Try to log in as nethome:

Code: Select all

sudo su - nethome
and go to the location an create/modify files, that might give some ideas why it is failing

Re: Change logging path to USB drive?

Posted: Tue Oct 17, 2017 7:21 am
by tvbcom
Thanks for answer.
For some unkown reason (I have played with so many idees) I finally got it to work.

The unknowed reason I guess/hope is this:

the directory tree to the logfile is /media/pi/gb/log
where gb is the USBdrive

I had to make directory "pi" "gb" and "log" and change the owner to "nethome"

I then had to create and the change write and owner manually on the logfiles