I am trying to backup my web root using duplicity and am having trouble excluding specific folders.
I want to back up /var/www/
that has manny subfolders containg sites :
eg :
/var/www/site1.com, /var/www/site2.com
I want to exclude logs and cache folders that can be annywhere in each sites folder structure.
eg :
/var/www/site1.com/cache, /var/www/site1.com/logs
or :
/var/www/site2.com/app/cache, /var/www/site2.com/app/logs
Cache folders are allways called 'cache' Log folders are allways called 'logs'
The command I am using (that does not work) is :
duplicity --include /var/www/ --exclude cache --exclude logs --exclude "**" / s3+http://domain.com/files/
And I get the following error :
Fatal Error: The file specification
cache
cannot match any files in the base directory
/
Useful file specifications begin with the base directory or some
pattern (such as '**') which matches the base directory.
I finally worked it out :
duplicity --exclude "**cache/**" --exclude "**logs/**" /var/www s3+http://domain.com/files/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With