Log files accessed on SMB share


#1

Hi there,

I would like to keep track of files those are accessed via the Raspberry like:

DATE – Fileshare\Filename

Only when these files are pressed to play. Is this possible?


#2

Samba doesn’t know what you do with the file, but logging access is possible.
https://wiki.samba.org/index.php/Setting_up_Audit_Logging


#3

If you only care about if the file was played in Kodi, a short script to watch the kodi log would do what you are looking for.


#4

I dont want to have OSMC to be pumped UP with logging, only just when a file is accessed/played, i want to have a line in the logging. Is this possible?


#5

Played on/from the same machine, yes.
Played from another machine as I wrote Samba would not know for what reason the file is accessed so the answer is no. You would need to log all file access and filter respectively.


#6

All the movies are stored on a NAS, which I connect from the RPi with samba.
It is not Samba which I want to have a logging from, but from the RPi that is accessing a file to play:

Example:

2018-01-14 12:34:00 File played //share/HD1/TheMovie.mkv

Is this really hard to realise?


#7

That’s quite easy, all logging is in .kodi/temp/kodi.log


#8

cat .kodi/temp/kodi.log | grep “Opening: smb”

Nice :slight_smile:


#9

Didn’t I suggest that 6 postings ago?