LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices


Reply
  Search this Thread
Old 06-22-2009, 06:49 AM   #1
manoj.linux
Member
 
Registered: Aug 2007
Posts: 284

Rep: Reputation: 17
Question rsync help


Hi,

I want to know wheather it is possible to ignore folder and file using rysnc ? if yes what will be syntax

Regards

Manoj
 
Old 06-22-2009, 07:27 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
You have to use the option --exclude=PATTERN.

Just a couple of examples: to copy a directory structure (just the directories, but not the files inside them) use
Code:
--include '*/' --exclude '*'
To exclude all the .nc.gz files:
Code:
--exclude=*.nc.gz
To exclude a directory called test and a directory called images:
Code:
--exclude=test/ --exclude=images/
 
Old 06-30-2009, 11:04 AM   #3
gael
Member
 
Registered: Aug 2008
Posts: 41

Rep: Reputation: 15
As well, you can use a file full of files / folders to exclude:

to do so, you have to use the option:

Code:
--exclude-from "./toexclude.general"
In the toexclude.general file:
Code:
cat toexclude.general
/cdrom
/dev
/media
/mnt
/proc
/sys
/tmp
HTH

G.

Last edited by gael; 06-30-2009 at 11:08 AM.
 
Old 06-30-2009, 11:18 AM   #4
gael
Member
 
Registered: Aug 2008
Posts: 41

Rep: Reputation: 15
And as usual:

man rsync

or

google > rsync
 
  


Reply



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
rsync help tsaravan Linux - Networking 0 12-05-2007 04:59 AM
Rsync server vs rsync over ssh humbletech99 Linux - Networking 1 10-18-2006 12:10 PM
Windows Rsync Upload to Linux Rsync - permissions inspleak Linux - Software 0 10-12-2004 02:49 PM
Rsync Help! dlc2000 Linux - Software 2 06-16-2004 01:15 AM
rsync DropHit Linux - Software 2 02-18-2004 08:54 PM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 03:37 PM.

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
Open Source Consulting | Domain Registration