Skip to content

Instantly share code, notes, and snippets.

@onurdegerli
Created January 13, 2014 14:45
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save onurdegerli/8401532 to your computer and use it in GitHub Desktop.
Linux rsync specific file with rsync command. Usage: ./rsync-one-file.sh /directory/file.php
#!/bin/bash
if [ -n "$1" ]
then
file=$1
rsync -crlPavpz --delete --exclude-from 'exclude.txt' /source-directory/$file user@192.168.1.1:/destination-directory/$file
else
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment