var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: file exist in folder.
i am new to shell scripting and want to write one script, the details is like
i want to check the file in particular folder, if that file is exists in folder more than three hours then send a message.
so please help me.
How frequently do you want to run this script?
Create a marker file, and use "touch" to change its date and time modified.
Then use "ls -tr" to list the files in chronological order, oldest first.
sleep 10800 #3 hours * 60 minutes * 60 seconds
ls -tr >list
while read a
if [ $a = "marker.lck" ]
echo $a "older than three hours"
I want to do filename as parameter, so how i can call filename as parameter.
i need to check two files in that directory, for that i can write a code for two files.
Which operating system are you using? There are various versions of the "date" command, some do date arithmetic others don't.
For example "Mar 1 2012 01:30" minus 3 hours is "Feb 29 2012 22:30".
Are you only interested in any three hours between 6am and 9 pm?
This link has lots of information Yesterdays Date/Date Arithmetic - The UNIX and Linux Forums