Discussion:
[rsnapshot-discuss] Excluding with wildcard
Thierry Lavallee
2016-03-02 17:01:32 UTC
Permalink
*1-I need to exclude certain directories from the remote server, but I
have multiple instances.*
/backup/USER001/homedir/archive-no-backup
/backup/USER002/homedir/archive-no-backup
/backup/USER003/homedir/archive-no-backup
/backup/USER004/homedir/archive-no-backup
/backup/USER005/homedir/archive-no-backup
/backup/USER....../homedir/archive-no-backup

Would I simply place this in my config?
exclude /backup/*/homedir/archive-no-backup

*2-I need to exclude files by wildcard*
Anything that has the extension .nobak

Would I simply place this in my config?
exclude *.nobak

3-Any documentation on this? So that I can go crazy with my exclude
patterns?

Thanks!
--
Thierry
Scott Hess
2016-03-02 17:12:21 UTC
Permalink
My approach to this is to use a config item like:

exclude_file /etc/rsnapshot.excludes

Then list things in that file, like:

; Common directories with transient churn.
/tmp/*
/var/tmp/*
/var/cache/*

; Anything named nobackup - including directories.
; TODO: nobackup/ instead?
nobackup

.mozilla/firefox/*/Cache

I like this because I can comment why things are there, which is helpful
three years later when I'm wondering why things are there :-). Cases like
/dir/* sync the directory itself, with no contents, so it ends up empty.
The bare name skips any direct match. The path with wildcard skips the
obvious bit of that. You can test this stuff out by experimenting with
rsync directly.

Note that if you add exclude= to a backup line, it overrides the
exclude_files= setting. I ended up using
exclude=/something/else,exclude_file=/etc/rsnapshot.excludes to fix it.

-scott
Post by Thierry Lavallee
*1-I need to exclude certain directories from the remote server, but I
have multiple instances.*
/backup/USER001/homedir/archive-no-backup
/backup/USER002/homedir/archive-no-backup
/backup/USER003/homedir/archive-no-backup
/backup/USER004/homedir/archive-no-backup
/backup/USER005/homedir/archive-no-backup
/backup/USER....../homedir/archive-no-backup
Would I simply place this in my config?
exclude /backup/*/homedir/archive-no-backup
*2-I need to exclude files by wildcard*
Anything that has the extension .nobak
Would I simply place this in my config?
exclude *.nobak
3-Any documentation on this? So that I can go crazy with my exclude
patterns?
Thanks!
--
Thierry
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
rsnapshot-discuss mailing list
https://lists.sourceforge.net/lists/listinfo/rsnapshot-discuss
Thierry Lavallee
2016-03-02 17:22:10 UTC
Permalink
so you mean that in my .excludes file I just need this?

; Excluding the backup directories in users directories and all nobak files
archive-no-backup
.nobak

Thanks!
--
Thierry
Post by Scott Hess
exclude_file /etc/rsnapshot.excludes
; Common directories with transient churn.
/tmp/*
/var/tmp/*
/var/cache/*
; Anything named nobackup - including directories.
; TODO: nobackup/ instead?
nobackup
.mozilla/firefox/*/Cache
I like this because I can comment why things are there, which is
helpful three years later when I'm wondering why things are there
:-). Cases like /dir/* sync the directory itself, with no contents,
so it ends up empty. The bare name skips any direct match. The path
with wildcard skips the obvious bit of that. You can test this stuff
out by experimenting with rsync directly.
Note that if you add exclude= to a backup line, it overrides the
exclude_files= setting. I ended up using
exclude=/something/else,exclude_file=/etc/rsnapshot.excludes to fix it.
-scott
On Wed, Mar 2, 2016 at 9:01 AM, Thierry Lavallee
*1-I need to exclude certain directories from the remote server,
but I have multiple instances.*
/backup/USER001/homedir/archive-no-backup
/backup/USER002/homedir/archive-no-backup
/backup/USER003/homedir/archive-no-backup
/backup/USER004/homedir/archive-no-backup
/backup/USER005/homedir/archive-no-backup
/backup/USER....../homedir/archive-no-backup
Would I simply place this in my config?
exclude /backup/*/homedir/archive-no-backup
*2-I need to exclude files by wildcard*
Anything that has the extension .nobak
Would I simply place this in my config?
exclude *.nobak
3-Any documentation on this? So that I can go crazy with my
exclude patterns?
Thanks!
--
Thierry
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
rsnapshot-discuss mailing list
https://lists.sourceforge.net/lists/listinfo/rsnapshot-discuss
Ken Woods
2016-03-02 17:39:54 UTC
Permalink
This post might be inappropriate. Click to display it.
Scott Hess
2016-03-02 17:59:50 UTC
Permalink
.nobak would exclude exactly things named .nobak , you would need *.nobak
to exclude things with that extension.

rsnapshot uses rsync, here, and rsync's manual page has a long section on
excludes/includes. I have never fully understood the intricacies, it is
easier to just experiment with sample directory structures.

-scott
Post by Thierry Lavallee
so you mean that in my .excludes file I just need this?
; Excluding the backup directories in users directories and all nobak files
archive-no-backup
.nobak
Thanks!
--
Thierry
exclude_file /etc/rsnapshot.excludes
; Common directories with transient churn.
/tmp/*
/var/tmp/*
/var/cache/*
; Anything named nobackup - including directories.
; TODO: nobackup/ instead?
nobackup
.mozilla/firefox/*/Cache
I like this because I can comment why things are there, which is helpful
three years later when I'm wondering why things are there :-). Cases like
/dir/* sync the directory itself, with no contents, so it ends up empty.
The bare name skips any direct match. The path with wildcard skips the
obvious bit of that. You can test this stuff out by experimenting with
rsync directly.
Note that if you add exclude= to a backup line, it overrides the
exclude_files= setting. I ended up using
exclude=/something/else,exclude_file=/etc/rsnapshot.excludes to fix it.
-scott
Post by Thierry Lavallee
*1-I need to exclude certain directories from the remote server, but I
have multiple instances.*
/backup/USER001/homedir/archive-no-backup
/backup/USER002/homedir/archive-no-backup
/backup/USER003/homedir/archive-no-backup
/backup/USER004/homedir/archive-no-backup
/backup/USER005/homedir/archive-no-backup
/backup/USER....../homedir/archive-no-backup
Would I simply place this in my config?
exclude /backup/*/homedir/archive-no-backup
*2-I need to exclude files by wildcard*
Anything that has the extension .nobak
Would I simply place this in my config?
exclude *.nobak
3-Any documentation on this? So that I can go crazy with my exclude
patterns?
Thanks!
--
Thierry
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
rsnapshot-discuss mailing list
https://lists.sourceforge.net/lists/listinfo/rsnapshot-discuss
------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
_______________________________________________
rsnapshot-discuss mailing list
https://lists.sourceforge.net/lists/listinfo/rsnapshot-discuss
Helmut Hullen
2016-03-02 17:28:00 UTC
Permalink
Hallo, Thierry,
Post by Thierry Lavallee
*1-I need to exclude certain directories from the remote server, but
I have multiple instances.*
/backup/USER001/homedir/archive-no-backup
/backup/USER002/homedir/archive-no-backup
/backup/USER003/homedir/archive-no-backup
/backup/USER004/homedir/archive-no-backup
/backup/USER005/homedir/archive-no-backup
/backup/USER....../homedir/archive-no-backup
Would I simply place this in my config?
exclude /backup/*/homedir/archive-no-backup
Yes - that works.

Viele Gruesse!
Helmut
Continue reading on narkive:
Loading...