Link to home
Start Free TrialLog in
Avatar of mce-man-it
mce-man-it

asked on

Create a Log file of files copied to a Public Folder, Add to a Perl script a log of files Uploaded

OK, this really is a two part question, here's what currently happens, approx. 8 photographers copy 100s of .eps files to a Public/Shared folder (a Mac running OSX), these files are then uploaded using a perl script run as a cron job, see link below to a previous question for this script.

https://www.experts-exchange.com/questions/24578592/Moving-files-from-a-watched-folder-directory.html

Part 1
Is there a way to keep track/log of each file copied (date stamped ip address of computer which uploaded file?) to the Public/Shared folder whether this is a perl script or any other way

Part 2
Modify/add to the upload script to also log each file it has uploaded

This is just to give me an audit trail from the upload Mac

Much appreciated in advance
ASKER CERTIFIED SOLUTION
Avatar of wilcoxon
wilcoxon
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mce-man-it
mce-man-it

ASKER

Thanks for the script going to give it a go, shortly.

The photographers just mount the Public folder via afp on there desktops and drag the files to the folder.
Got the script working thanks for your help just needed a couple of tweeks, i've posted the amends just in case somebody else finds it useful, the line my $host just needed adding back in also just needed to tweek the open log line, i've used the path to where the mac stores its other logs and it is viewable in the Console app, in the line return sprintf there was a $ instead of a %.

As to the first part i'm going to see if turning on logging in the AppleFileService works for logging files copied to the shared folder.

Thanks again for your time
my $host = 'xx.xx.xx.xx';

open(LOG, ">>/Library/Logs/Upload.log") or die "could not write to the log: $!";



return sprintf '%d/%02d/%02d %d:%d:%d', $yr, $mon, $mday, $hour, $min, $sec;

Open in new window