PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > comp.unix.shell > How to exclude MULTIPLE directories in a rsync command ?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.unix.shell Using and programming the Unix shell.

How to exclude MULTIPLE directories in a rsync command ?

Réponse
 
LinkBack Outils de la discussion
Vieux 07/05/2008, 06h57   #1
Matthew Lincoln
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut How to exclude MULTIPLE directories in a rsync command ?

As I learned from the man page of rsync I can exclude a certain directory (trees)
by using the --exclude option like in

rsync .... --exclude=/proc ....

But how do I exclude multiple directory (trees) at once in such a rsync command?
The following does not work:

rsync .... --exclude=/proc||/var||/dummy ....

Same with "&&" instead of "||"

Matthew
  Réponse avec citation
Vieux 07/05/2008, 09h18   #2
Owen
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: How to exclude MULTIPLE directories in a rsync command ?

On May 7, 3:57 pm, kmlincoln...@hotmail.com (Matthew Lincoln) wrote:
> As I learned from the man page of rsync I can exclude a certain directory (trees)
> by using the --exclude option like in
>
> rsync .... --exclude=/proc ....
>
> But how do I exclude multiple directory (trees) at once in such a rsync command?
> The following does not work:
>
> rsync .... --exclude=/proc||/var||/dummy ....
>
> Same with "&&" instead of "||"
>
> Matthew



*NOT TESTED* but looking at the man pages,

I think you need to make a file, say ~/.rsync/excludes

and the excludes file would read something like;
/proc/
/var/
/dummy/

and then your rsync command would read, in part, rsync --exclude-
from=~/.rsync/excludes

Try that and see what happens.


Owen
  Réponse avec citation
Vieux 07/05/2008, 09h42   #3
Chris Davies
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: How to exclude MULTIPLE directories in a rsync command ?

In comp.os.linux.misc Matthew Lincoln <kmlincoln100@hotmail.com> wrote:
> As I learned from the man page of rsync I can exclude a certain
> directory (trees) by using the --exclude option like in
> rsync .... --exclude=/proc ....


> But how do I exclude multiple directory (trees) at once in such a
> rsync command?


You get good marks for reading the man page. (You'd be amazed how many
people don't even bother to try...) I think the bit you missed is this:

Note also that the --filter, --include, and --exclude options take one
rule/pattern each. To add multiple ones, you can repeat the options
on the command-line [...]

Personally, I don't find the interaction between the --include/--exclude
directives particularly intuitive. If it's simply a case of "exclude
this and that", then you should be fine. However, as soon as I wanted to
"include this but exclude that", I ended up taking some of the working
examples (from the man page) and tweaking them until I got something
that worked.

Chris
  Réponse avec citation
Vieux 08/05/2008, 07h27   #4
Nico Kadel-Garcia
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: How to exclude MULTIPLE directories in a rsync command ?

On 7 May, 09:42, Chris Davies <chris-use...@roaima.co.uk> wrote:
> In comp.os.linux.misc Matthew Lincoln <kmlincoln...@hotmail.com> wrote:
>
> > As I learned from the man page of rsync I can exclude a certain
> > directory (trees) by using the --exclude option like in
> > rsync .... --exclude=/proc ....
> > But how do I exclude multiple directory (trees) at once in such a
> > rsync command?

>
> You get good marks for reading the man page. (You'd be amazed how many
> people don't even bother to try...) I think the bit you missed is this:
>
> Note also that the --filter, --include, and --exclude options takeone
> rule/pattern each. To add multiple ones, you can repeat the options
> on the command-line [...]
>
> Personally, I don't find the interaction between the --include/--exclude
> directives particularly intuitive. If it's simply a case of "exclude
> this and that", then you should be fine. However, as soon as I wanted to
> "include this but exclude that", I ended up taking some of the working
> examples (from the man page) and tweaking them until I got something
> that worked.
>
> Chris


Yeah, to get those to work in a sophisticated fashion, it's best to
write a configuration file which you edit for reference, rather than
the comand line.
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 19h10.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,28743 seconds with 12 queries