I wrote this perl script to monitor a directory for changes in files such as ,

  • Created
  • Deleted
  • Modified

A directory is given on the command-line and the script continuously checks for changes until it is halted (ctrl+c).

Example output,

$ ./directory_monitor.pl /tmp/

Monitoring directory: /tmp/
        (ctrl+c to halt)

20080209.145857 : test.txt      Created. [0b]
20080209.145904 : test.txt      Size changed to 375b (up 375b)

 
 

I was having issues with MythTV prematurely deleting recorded shows, and this script proved its worth in determining when they were deleted.

Download

  directory_monitor.pl (4.6 KiB, 2,073 hits)

4 Responses to “directory_monitor.pl – Monitor directory for file changes”

  1. Gabriel

    Great Script!

    I want to do something similar, not exactly this but your script will save the day :-)

    Thanks!

    April 17th, 2008 | 12:47am
  2. Like to download this script

    October 12th, 2009 | 6:08am
  3. Sorry. Download link is fixed now.

    October 12th, 2009 | 10:30am
  4. Prasith

    I want to know how to display ACL on a directory.
    Please give me an exemple.

    February 1st, 2010 | 1:25pm

Leave a Reply