Asking
Only logged in members can reply and interact with the post.
Join SimilarWorlds for FREE »

Monitoring a shared folder.

I have a folder exported by a Windows machine mounted on a Linux machine's filesystem. inotifywait, running on the Linux machine, detects when the Linux machine acts on the folder but not when the Windows machine does. Is there a way for the Linux machine to monitor the folder for files inserted by the Wondows machine?
ninalanyon · 61-69, T
If you haven't found a solution in the intervening year and a half you could write a short script something like this



while true
do
touch "${newSentinel}"
find "${sharedfolder}"-newer "${oldSentinel}" -exec /fullpath/to/actOn {} \;
mv "${newSentinel}" "${oldSentinel}"
sleep ${monitorPeriod}
done
Call it something like monitor-shared-folder

where acTon is a script that does whatever it is you want done. Don't forget to initialise oldSentinel

Add this to your crontab and tell it to execute on boot:

@reboot /fullpath/to/monitor-shared-folder

I haven't tested this of course :-)

 
Post Comment