Code:
Expand|Select|Wrap|Line Numbers
- #!/usr/bin/perl
- use File::stat;
- use Time::localtime;
- my @a = glob "*" ;
- foreach (@a) {
- if ( -e $_)
- {
- my $d = ctime(stat($_)->mtime);
- print "FILE: $_ \n DATE UPDATED: $d.\n";
- }
- else
- {
- print "No file found $_.\n";
- }
- }
Expand|Select|Wrap|Line Numbers
- Code:
- FILE: mrm
- DATE UPDATED: Fri Jul 23 21:35:03 2010.
- FILE: mysql
- DATE UPDATED: Fri Jul 23 21:37:08 2010.
My problem is how will I add on the script above where it will display the file and date when it has no backup.
Sample Output: (let say the directory does not update for two days (Jul 22 and 23).
Expand|Select|Wrap|Line Numbers
- FILE: mysql
- REMARKS: No Backup on Thu Jul 22 2010.
- No Backup on Fri Jul 23 2010.