First off, why might there be doubt as to whether or not files are actually getting backed up?
I think you'd be better off recording the output of whatever you are using to back up the files (rsync probably?) and just checking every now and then to make sure there are no errors.
That said, you could certainly check the timestamps of files in a bash script and see how old they are, although I think it's kind of the hard way to do do things.
consider a script like this:
Code:
#!/bin/bash
#list the files and loop through them all
ls -l | while read LINE
do
#get the date from the ls line
DATE=`echo $LINE | awk '{print $6}'`
#get the day of month out of the date
FDOM=`echo $DATE | awk -F '-' '{print $3}'`
#get the month
FMON=`echo $DATE | awk -F '-' '{print $3}'`
#you could do all sorts of checking here to see if the date is 5 or more days ago, then send an email or whatever.
done
Of course if you go this route, you'll need to be familiar with bash scripting and awk and some basic arithmetic in bash
Also look into the "date" command.
I think all this scripting is a worthwhile thing to learn, I just think maybe for your application it might not make the most sense.
Bookmarks