Skip to content

Instantly share code, notes, and snippets.

@qichunren
Last active March 1, 2020 06:22
Show Gist options
  • Save qichunren/eba241497133e103175f1851fe0a6536 to your computer and use it in GitHub Desktop.
Save qichunren/eba241497133e103175f1851fe0a6536 to your computer and use it in GitHub Desktop.
Auto sync source dir to target host.
#!/bin/bash
echo "Start rsync daemon ..."
for (( ; ; ))
do
echo "rsync checking ... [ hit CTRL+C to stop]"
rsync -az --exclude 'log/' --exclude 'tmp/' --exclude 'public/' --exclude 'node_modules/' --exclude '.git/' --exclude 'Gemfile.lock' --exclude 'yarn.lock' backend_www xxxxxx@192.168.43.175:/home/xxxxxxx/code/ --delete
sleep 3
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment