Tuesday, May 17, 2016

SCP copy files recursively and exclude file

To copy files recursively from remote using SCP, just use flag "-r" like this:

$ scp -r user@acidstaging.com:/home/dltr/public_html/current/trunk/* ./trunk/

If you would like to exclude some files then use either of these:

exclude dot files:

$ scp -r [!.]* user@acidstaging.com:/home/dltr/public_html/current/trunk/* ./trunk/

exclude .svn files:

$ scp -r [!.svn] user@acidstaging.com:/home/dltr/public_html/current/trunk/* ./trunk/

For Rsync check this post.

http://www.snpts.org/2016/04/rsync-multiple-examples-to-exclude.html

No comments:

Post a Comment