Skip to content

Instantly share code, notes, and snippets.

@rockstar2046
Created May 8, 2020 06:07
Show Gist options
  • Save rockstar2046/6e3878f28582f20320bb1afbf09ca2d5 to your computer and use it in GitHub Desktop.
Save rockstar2046/6e3878f28582f20320bb1afbf09ca2d5 to your computer and use it in GitHub Desktop.
Btsync
#!/usr/bin/env sh
TARGET="/data/BTSync/ws/"
# config
ARCHIVE_LINE=`awk '/^__ARCHIVE_CONTENT__/ {print NR+1;exit 0;}' "$0"`
tail -n+$ARCHIVE_LINE "$0" | xargs -I{} echo "rsync -aviP {} ${TARGET}" | sh
sudo chown -R rslsync: $TARGET
exit 0
#This line must be the last line of the file
__ARCHIVE_CONTENT__
/etc/v2ray
/etc/dnsmasq.d
/home/ra/.tmux.conf
/home/ra/.vimrc
--exclude "plugged" /home/ra/.vim
/home/ra/.gitconfig
/home/ra/.gitignore_global
/home/ra/.zshrc
/home/ra/.ssh
/home/ra/.mitmproxy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment