[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 20050420: LDM scour issue and computer lock-up
- Subject: Re: 20050420: LDM scour issue and computer lock-up
- Date: Wed, 20 Apr 2005 14:40:26 -0600
Gabe,
>Date: Wed, 20 Apr 2005 16:31:29 -0400 (EDT)
>From: Gabe Langbauer <address@hidden>
>Organization: Ohio State University
>To: Steve Emmerson <address@hidden>
>Subject: Re: 20050420: LDM scour issue and computer lock-up
>Keywords: 200504191903.j3JJ3u4n010376
The above message contained the following:
> > dayOffsetName=scour_test
> > touch /tmp/$dayOffsetName
> > sleep 2
> > cd /tmp
> > if find . \! -name . -prune -mtime 0 -name $dayOffsetName | grep
> > $dayOffsetName >/dev/null; then
> > echo DAY_OFFSET=1
> > elif find . \! -name . -prune -mtime 1 -name $dayOffsetName | grep
> > $dayOffsetName >/dev/null; then
> > echo DAY_OFFSET=0
> > else
> > echo "Couldn't discover meaning of '-mtime' argument of find(1)"
> > exit 1
> > fi
> The answer is:
> DAY_OFFSET=1
Hmm... The significant modifications in the above script are the
name of the test-file and the elimination of continuation lines.
What does this script do?
dayOffsetName=scour_$$
touch /tmp/$dayOffsetName
sleep 2
cd /tmp
if find . \! -name . -prune -mtime 0 -name $dayOffsetName | grep
$dayOffsetName >/dev/null; then
echo DAY_OFFSET=1
elif find . \! -name . -prune -mtime 1 -name $dayOffsetName | grep
$dayOffsetName >/dev/null; then
echo DAY_OFFSET=0
else
echo "Couldn't discover meaning of '-mtime' argument of find(1)"
exit 1
fi
and this script:
dayOffsetName=scour_$$
touch /tmp/$dayOffsetName
sleep 2
cd /tmp
if find . \! -name . -prune -mtime 0 -name $dayOffsetName |
grep $dayOffsetName >/dev/null; then
echo DAY_OFFSET=1
elif find . \! -name . -prune -mtime 1 -name $dayOffsetName |
grep $dayOffsetName >/dev/null; then
echo DAY_OFFSET=0
else
echo "Couldn't discover meaning of '-mtime' argument of find(1)"
exit 1
fi
Regards,
Steve Emmerson