![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| File Modified : Alert me | StrengthThaDon | UNIX for Dummies Questions & Answers | 6 | 04-08-2008 04:23 PM |
| perl find directory only if modified in last hour | frustrated1 | Shell Programming and Scripting | 0 | 10-12-2007 05:50 PM |
| an hour less in 24 hour system | bobo | UNIX for Dummies Questions & Answers | 3 | 10-23-2006 12:55 PM |
| What resides on my server(s) | keith.m | UNIX for Dummies Questions & Answers | 0 | 07-18-2006 03:03 PM |
| ALERT!!! ALERT!!! I messed up the UNIX!!! | Fwurm | UNIX for Dummies Questions & Answers | 15 | 11-06-2001 05:53 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
If any file resides for more than an hour in this directory then to raise an alert
Hi
If there is a file upload done from a remote server and if the file remains without being extracted for more than an hour, I need to identify the files and create an alert message to the users in the other end. please help me writing a shell script for it. Regards Yazhini |
|
|||||
|
If you have perl, this script will find all files not modified in the last hour... Code:
#!/usr/bin/ksh
function file_hours {
perl -e 'printf "%i\n", 24*(-M shift);' -- $1
}
cd wherever
for file in *
do
if [[ $(file_hours $file) -ge 1 ]]
then
echo $file is old
else
echo $file is new
fi
done
|
![]() |
| Bookmarks |
| Tags |
| perl, perl shift, shift, shift perl |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|