Browse Source

folder copy with mutex

master
n0m1s 6 years ago
parent
commit
cb5ef43b99
1 changed files with 15 additions and 0 deletions
  1. +15
    -0
      folder-copy.sh

+ 15
- 0
folder-copy.sh View File

@ -0,0 +1,15 @@
#!/bin/bash
lockfile=lock
: >> ${lockfile}
exec 9>${lockfile}
if ! flock -n 9 ; then
#Another instance is running
exit 1
fi
#TODO: rsync
: > ${lockfile}

Loading…
Cancel
Save