Linux – BackupPC: How to include and exclude in the same directory

backuplinux

I have set up BackupPC on a CentOS server, and it works great.

The only problem I have is; How do I exclude everything in /media/ except /media/ncpvolues/ ?

Here is a screenshot of what I have tried so farscreenshot

This approach doesn't include /media/ncpvolumes/ as hoped.

Best Answer

The reason you have a problem here is that you are trying to back everything up using one share (in this case /).

What you need to do is have at least two shares: one for / and one for /media/ncpvolumes/

Then for the / share exclude dev/ proc/ tmp/ mnt/ media/ var/named/chroot/proc var/cache as you have done so in your existing configuration. Make sure media/ is excluded.

Then for the /media/ncpvolumes share do not exclude anything.

That will have the result of backing up everything in /media/ncpvolumes but nothing else in /media.