LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-04-2014, 01:25 PM   #1
Drigo
Member
 
Registered: Jun 2009
Posts: 111

Rep: Reputation: 17
Angry scp -r $FOLDER but omit ONLY $FOLDER/$SUBFOLDER2 ??


SO lets say I have the following folder with subfolders in a host machine:

$FOLDER/*files*
$FOLDER/$SUBF1
$FOLDER/$SUBF2
$FOLDER/$SUBF3
$FOLDER/$SUBF4
$FOLDER/$SUBF5

From my client, I want to copy all the folder but omit ONLY the subfolder $SUBF2?
How can I do so?
 
Old 11-04-2014, 09:16 PM   #2
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and Scientific Linux
Posts: 5,753

Rep: Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288Reputation: 1288
Hi,

you could use rsync instead and make use of the --exclude option. Eg
Code:
rsync -r -e ssh --exclude $SUBF2 $FOLDER user@otherhost:somedir
Evo2.

PS. You probably don't need the '-e ssh' since this is the default on most systems.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
make multiple folder on samba linux & each folder can be access each person only Aneesh.T .S Linux - Server 1 01-31-2013 07:01 PM
MyLQ, subscription folder, empty current folder fails with more than 100? threads zhjim LQ Suggestions & Feedback 2 06-08-2012 12:14 PM
[SOLVED] How to copy a folder with sub directories using scp sanjay87 Linux - Server 5 05-24-2012 07:40 AM
Auto syncing folder from Linux to Windows, SCP/Rsync? batfastad Linux - Software 2 11-26-2010 03:08 AM
scp restriction to particular folder malickhat Linux - Newbie 9 09-26-2010 06:25 PM


All times are GMT -5. The time now is 10:04 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration