Created
September 16, 2024 15:30
-
-
Save dumbasPL/a7ce57a378574629da00a2851e238012 to your computer and use it in GitHub Desktop.
sync.sh
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
#!/usr/bin/env bash | |
set -e | |
SCRIPT_DIR="$(dirname "$0")" | |
LOCKFILE="$SCRIPT_DIR/.sync.lock" | |
echo "waiting..." | |
exec {lock_fd}>"$LOCKFILE" | |
flock "$lock_fd" || exit 1 | |
echo "running..." | |
rsync -rltv ~/private/deluge2/completed/ nas:download/ |& tee -a "$SCRIPT_DIR/sync.log" | |
echo "done" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment