rsync issue

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?
 
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]

?
 
The wildcards are not needed:
Code:
--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.
 
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.
 
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...
 
Back
Top