Using "touch" and "test -e" as a lock test is not safe. If the shell dies for any reason, the lock file will get stale. If you sync station is linux, a safer option is to use the flock(1) program: