LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 10-19-2012, 05:46 AM   #1
ust
Senior Member
 
Registered: Mar 2003
Location: fasdf
Distribution: Debian / Suse /RHEL
Posts: 1,130

Rep: Reputation: 30
rcp exclude directory


I want to rcp file to remote server but exclude a specific directory "bak" , I tried the below command but not work , it still copy everything from current directory , can advise what can i do ?


thanks.



rcp ./* root@remoteserver:/tmp --exclude=bak
 
Old 10-19-2012, 09:46 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 18,991

Rep: Reputation: 4316Reputation: 4316Reputation: 4316Reputation: 4316Reputation: 4316Reputation: 4316Reputation: 4316Reputation: 4316Reputation: 4316Reputation: 4316Reputation: 4316
Quote:
Originally Posted by ust View Post
I want to rcp file to remote server but exclude a specific directory "bak" , I tried the below command but not work , it still copy everything from current directory , can advise what can i do ?
Code:
rcp ./* root@remoteserver:/tmp --exclude=bak
If you read the man page for that command, you'd see that it doesn't support file exclusions. Did you even try to read the man page on rcp??? Also, rcp, rsh, and rexec are VERY BAD THINGS to be using. They are old, insecure, and are easily replaced by ssh/scp.

While rcp can't do it natively, you can make it work:
Code:
rcp `ls {{whatever pattern}} |grep -v 'exclude this'` {{remotehost}}
And again...after nine years, shouldn't this be something you could have looked up?
 
  


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
trying normal rcp (/usr/bin/rcp) Permission denied. Martin Peter Clarke Linux - Server 5 12-21-2010 10:42 AM
exclude directory with cp hampel Linux - Software 3 06-04-2009 11:59 AM
How to exclude a Directory with TAR fw12 Linux - Software 3 03-28-2008 04:43 AM
Mod_rewrite exclude directory Albin Joseph Linux - Server 1 10-22-2007 04:51 AM
exclude directory from find ebasi Linux - Software 8 07-17-2004 02:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:43 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