Log files accessed on SMB share

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?

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

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.

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?

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.

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?

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

1 Like

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

Nice :slight_smile:

Didn’t I suggest that 6 postings ago?