Created
July 14, 2018 21:22
-
-
Save zackn9ne/098d74dec292d6ae21d0d7994f621c1f to your computer and use it in GitHub Desktop.
rsync lock file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
if [ -e /cygdrive/c/Users/admin/rsyncjob.lock ] | |
then | |
echo "Rsync job already running...exiting" | |
exit | |
fi | |
touch /cygdrive/c/Users/admin/rsyncjob.lock | |
#your code in here | |
rsync -avzhP --rsh='ssh -p2222' user@YOURIP:~/Downloads/* ./ | |
#delete lock file at end of your job | |
rm /cygdrive/c/Users/admin/rsyncjob.lock |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment