Hello colox
In the past "something similar" was asked from another fellow Monk see Method to verify an environment with changes.
You might be looking for something like:
#!/usr/bin/perl use strict; use warnings; use File::stat; use Data::Dumper; use Time::localtime; use File::Find::Rule; sub get_files { my @dirs = ('/home/user/Monks' , '/home/user/Monks/mySubDir'); # a +dd more my $level = shift // 2; # level to dig into my @files = File::Find::Rule->file() ->name('*.xml', '*.txt') # add your file(s) extension(s) ->maxdepth($level) ->in(@dirs); return @files; } my @files = get_files(); my %hash; for (@files) { $hash{$_} = ctime(stat($_)->mtime); } # or # for (@files) { $hash{ctime(stat($_)->mtime)} = $_; } print Dumper \%hash; __END__ $ perl test.pl $VAR1 = { '/home/user/Monks/ArabicCharacters/original.txt' => 'Fri Jul + 28 13:21:04 2017', '/home/user/Monks/out.txt' => 'Thu Jul 20 13:29:41 2017', '/home/user/Monks/filter.txt' => 'Thu Jul 13 11:03:53 2017', . . . };
Although you said that you have implemented something similar, I would combine it with git CPAN module(s). At the end with the help of git you can check for the file(s) when they where last updated based on the date and then check what has changed and by whom?
Hope this helps, BR.
In reply to Re: Monitor new file
by thanos1983
in thread Monitor new file
by colox
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |