Monitor and Email Server Directory Changes

Subscribe

Recently, I’ve been trying to develop a Cron job or Perl script that would help me monitor two sets of FTP uploads: SCRIPTjr.nl submissions and media files related to one of the two podcasts Studio Hyperset manages for the Black Mountain Institute. Essentially, this script would (a) watch a certain server directory and (b) email me whenever files are added to that directory.

It took a good bit of sleuthing, but I finally came across Jonathan Franzone’s fantastic directory monitoring PHP script. He’s posted all the necessary instructions on his site, but it’s probably worth stating that, for the script to work in my server environment, I did, as Franzone suggests, need to add #!/usr/bin/env php to the top of the PHP script (above the initial <?php ). Moreover, after dropping the customized script in the directory I wanted to monitor, I also needed to set the script’s permissions (chmod) to 755. Otherwise, the script emailed me a series of error messages instead of server directory changes.

After customizing and uploading the script, I created up a simple weekly Cron job that executes the script via its full server path. If you’re looking for an easy way to find the script’s path on your server — or the path of any file, for that matter — here are two options courtesy of Hiroshi:

If these pages and/or scripts ever merge with the infinite, SH has archived copies. Feel free to reach out to us if needs be.

Build a data-driven content engine & lead funnel

From Website to WebMIGHT!

    Your guide to building a data-driven content engine, lead funnel & next-gen online presence.

Next-Gen Website Anatomy

    Next-gen website anatomy is dynamic, lean, and tailored to marketing data.

Posted in "Métier."

Tags:

Quimby Melton

Founder/President

Quimby is the founder and president of Studio Hyperset. He started Studio Hyperset in 2006 after studying Transatlantic literature and culture, new media, and humanities computing at the Universities of Georgia (AB, 00) and Nevada, Las Vegas (MA, 03; PhD, 08). He has a background in literary studies, media production, front-end development, and project management. His current primary duties involve helping clients frame solutions that meet their needs; scoping and managing Studio Hyperset's growth strategy and business development pipeline; finding and developing talent; and, most importantly, supporting the SH team.