On Thu, 12 Feb 2009 07:06:28 -0800, Boyd Stephen Smith Jr.
Hrm, sounds like you always want to copy the file, not just when you haven't had to wait for it.
This is ran nightly via cron.. The part I am having problems with is the sniffing for that file. So here is what I have:
find /tmp/file -mmin -1 >/dev/null if [ $? -eq 0 ]; then
Can be made a single line.
while [ find /tmp/file -mmin -1 >/dev/null -eq 0 ]; do
-eq doesn't work that way. Just drop the '[' and '-eq 0 ]' and it'll do what you want.
sleep 59 done else cp /tmp/file /somewhere fi
My attempt: while find /tmp/file -mmin -1 >/dev/null; do sleep 59 done cp /tmp/file /somewhere
Boyd, Yes, I want to sleep without copying the file, and when the condition was met (file is modified in the last minute) then stop sleeping and send. Here is a little something I just put together, and really thought it would work: FILE=`find /tmp/file -mmin -1` while [ -e $FILE ]; do echo "I feel like sleeping" >/tmp/otherfile exit 1 done echo "Yay look" >/tmp/otherfile But it doesn't continue the condition. I tried what you suggested and it also did about the same thing mine does. What I am looking for is: Keep searching for a certain file, and if it was modified in the last minute then copy it to another location, if it wasn't modified in the last minute, then sleep and check again in 58 seconds. -- I say never be complete. I say stop being perfect. I say let's evolve. Let the chips fall where they may. -Fight Club -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org