# rsync issue



## kevinwincott (Feb 21, 2013)

Hi

I*'*m trying to back up a server using rsync, the command *I'm* using is:

`rsync -aAXv /* /mnt/nas/today --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,*/mnt/*,/media/*,/lost+found}`

and

`rsync -aAXv /* /mnt/nas/today --exclude={/dev/*,/proc/*,/sys/*,/tmp/*,/run/*,/mnt/*,/media/*,/lost+found}`

However the folders in the exclude list are being synced. The commands work fine on an Ubuntu server and perform as expected.

What am I missing that*'*s unique to FreeBSD?


----------



## kisscool-fr (Feb 21, 2013)

Hi, 

I'm not sure rsync in FreeBSD supports comma separated values. 

Have you tried like this 

[CMD=""]rsync -aAXv /* /mnt/nas/today --exclude=/dev/* --exclude=/proc/* --exclude=/sys/* --exclude=/tmp/* --exclude=/run/* --exclude=/mnt/* --exclude=/media/* --exclude=/lost+found[/CMD]

?


----------



## wblock@ (Feb 21, 2013)

The wildcards are not needed:

```
--exclude=dev --exclude=proc ...
```

The original form may take advantage of some feature of bash.  The same should work on FreeBSD under bash or maybe even sh.


----------



## phoenix (Feb 21, 2013)

Even better, stick your excludes into a text file, one directory per line, and use *--exclude-from=/path/to/file* instead of tonnes of --exclude entries on the command-line.


----------



## chatwizrd (Feb 21, 2013)

Naw I like tons of --exclude lines better then a file


----------



## jb_fvwm2 (Feb 21, 2013)

Once I found the exclude file syntax that worked, I found it easy to use as one could name the exclude file depending upon the destination of the rsync...


----------

