Hypothetical file system monitoring question
-
Hi all
Not looking for a solution here, but pointers.
If I wanted to assess the age of a file on the host FS (Debian Bullseye in this case) then have an MSR reaction should that file be less than a certain age, what's a good starting point for me to learn how this might be accomplished?
TIA
C
-
There are apis for read/write, but not to get attributes. Shortest path is to write a bash script and capturing the output to a variable.
@therealdb said in Hypothetical file system monitoring question:
There are apis for read/write, but not to get attributes. Shortest path is to write a bash script and capturing the output to a variable.
I'd got that far
C
-
You can use a Shell Command action to run
stat -c %Y <filename>
and save the output to a variable. That will be the last modification time in this example, as an Epoch timestamp in seconds. You need to multiply that by 1000 to use it, because Reactor's timestamps are in milliseconds.