[SOLVED] rsync lockfile - multipul instances of script running

view story

http://ubuntuforums.org – i have a rsync script setup to check for new files on a remote machine every 5 minutes. it these are large files so it takes longer then 5 minutes to transfer. what i would like to have is rsync check every 5 minutes and download new files, but if another instance of that script is running then to close/quit. from what ive read on the internet is to make a lock file, and ive tried a couple so far with no success: Code:           LOCK=<pathrun in inn.conf>/LOCK.send           trap 'rm -f ${LOCK} ; exit 1' 1 2 3 15   (Hardware)