Skip to content

Instantly share code, notes, and snippets.

@dumbasPL
Created September 16, 2024 15:30
Show Gist options
  • Save dumbasPL/a7ce57a378574629da00a2851e238012 to your computer and use it in GitHub Desktop.
Save dumbasPL/a7ce57a378574629da00a2851e238012 to your computer and use it in GitHub Desktop.
sync.sh
#!/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