Discussion:
[rsnapshot-discuss] rsnapshot is putting backups of different directories/sub directories all into only one directory
Roy Krikke
2016-01-19 14:09:22 UTC
Permalink
Hello,

I'm new to this mailing-list. Forgive me if I ask a question that has been
answered previously.

So whenever I use rsnapshot to backup different directories such as
/home/user_a/Maildir/
or /home/user_b/Maildir/ it backs them up but in the folder specified to
store the backups, it does not keep separate folders for /home/user_a/Maildir/
/home/user_b/Maildir/, instead it just dumps it all together in the
hourly.x folder.

I have another rsnapshot config file that isn't doing this, the difference
is the version of rsnapshot and the OS installed on the host. Why is it
doing this and how can I fix it?

Host A:
- FreeBSD 10.2-RELEASE-p8
- rsnapshot 1.4.0
- rsync 3.1.1 protocol version 31

Host B:
- Ubuntu 14.04.1
- rsnapshot 1.3.1
- rsync 3.1.0 protocol version 31

If I use on Host A rsnapshot.conf (snapshot):
*retain hourly 24*
*#cmd_cp /bin/cp*
* # Mail server host.lan*
* backup ***@host.lan:/home/user_a/Maildir/
<***@host.lan:/home/user_a/Maildir/> host.lan/*


* backup ***@host.lan:/home/user_b/Maildir/
<***@host.lan:/home/user_b/Maildir/> host.lan/ *it does *not *keep
separate folders for /home/user_a/Maildir/ and /home/user_b/Maildir/,
instead it just dumps it all together in the hourly.x folder.

If I use on Host A rsnapshot.conf (snapshot):
*retain hourly 24*
*#cmd_cp /bin/cp*
*# Mail server host.lan*
*backup ***@host.lan:/home/user_a/Maildir/
<***@host.lan:/home/user_a/Maildir/> host.lan/home/user_a/Maildir/*


*backup ***@host.lan:/home/user_b/Maildir/
<***@host.lan:/home/user_b/Maildir/> host.lan/home/user_b/Maildir/ *it
does keep separate folders for /home/user_a/Maildir/ and /home/user_b/Maildir/,
so nice different directories/sub directories in hourly.x folder.

Host B:
- Ubuntu 14.04.1
- rsnapshot 1.3.1
- rsnapshot.conf (snapshot)
*retain hourly 24*
* cmd_cp /bin/cp*
* # Mail server host.lan*
*backup ***@host.lan:/home/user_a/Maildir/
<***@host.lan:/home/user_a/Maildir/> host.lan/*

*backup ***@host.lan:/home/user_b/Maildir/
<***@host.lan:/home/user_b/Maildir/> host.lan/ *it does keep
separate folders for /home/user_a/Maildir/ and /home/user_b/Maildir/, so
nice different directories/sub directories in hourly.x folder.


Why is the behavior of host a and host b different and how can I fix it?

Thank,
Roy
David Keegel
2016-01-20 08:53:54 UTC
Permalink
Roy,

The first thing I would look at is whether --relative is included
in your rsync arguments. With loglevel 3 (which is default) the
rsync command will be logged to the log file, if you want to check.

You can make rsync_long_args explicit in case by default host A's
rsnapshot does not include --relative, by putting this in your
/etc/rsnapshot.conf (or whereever you put the config) :-

rsync_long_args --delete --numeric-ids --relative --delete-excluded

This should give you the behaviour of host B (the directory structure
of the source is replicated in the destination/backup directory).
Post by Roy Krikke
Hello,
I'm new to this mailing-list. Forgive me if I ask a question that has
been answered previously.
So whenever I use rsnapshot to backup different directories such as
/home/user_a/Maildir/ or /home/user_b/Maildir/ it backs them up but in
the folder specified to store the backups, it does not keep separate
folders for /home/user_a/Maildir/ /home/user_b/Maildir/, instead it
just dumps it all together in the hourly.x folder.
I have another rsnapshot config file that isn't doing this, the
difference is the version of rsnapshot and the OS installed on the
host. Why is it doing this and how can I fix it?
- FreeBSD 10.2-RELEASE-p8
- rsnapshot 1.4.0
- rsync 3.1.1Â protocol version 31
- Ubuntu 14.04.1
- rsnapshot 1.3.1
- rsync 3.1.0Â protocol version 31
retain         hourly 24
#cmd_cp      /bin/cp
# Mail server host.lan
it does not keep separate folders for /home/user_a/Maildir/ andÂ
/home/user_b/Maildir/, instead it just dumps it all together in theÂ
hourly.x folder.
retain         hourly 24
#cmd_cp      /bin/cp
# Mail server host.lan
host.lan/home/user_a/Maildir/
host.lan/home/user_b/Maildir/
it does keep separate folders for /home/user_a/Maildir/ and
/home/user_b/Maildir/, so nice different directories/sub directories in
hourly.x folder.
- Ubuntu 14.04.1
- rsnapshot 1.3.1
- rsnapshot.conf (snapshot)
retain         hourly 24
cmd_cp      /bin/cp
# Mail server host.lan
it does keep separate folders for /home/user_a/Maildir/ and
/home/user_b/Maildir/, so nice different directories/sub directories in
hourly.x folder.
Why is the behavior of host a and host b different and how can I fix it?
Thank,
Roy
--
___________________________________________________________________________
David Keegel <***@cyber.com.au> Cyber IT Solutions Pty. Ltd.
http://www.cyber.com.au/~djk/ Linux & Unix Systems Administration
Roy Krikke
2016-01-20 16:47:59 UTC
Permalink
Hello ken Woods and David Keegel,

I've been carefully reading rsnapshot's howto and manual pages.

The documentation is extremely verbose about tabs and I quote from the
man page:
"All parameters in this file must be separated by tabs"
"Remember that tabs must separate all elements, ..."
"# THIS IS A COMMENT, REMEMBER TABS MUST SEPARATE ALL ELEMENTS"
"Make sure you don’t have spaces in the config file that you think are
actually tabs"
"Make sure your /etc/rsnapshot.conf file has all elements separated by
tabs."

So, I've separated everything with tabs, including the parameters from
rsync_long_args. During my testing and running rsnapshot with -V the
resulting command didn't contain the parameters from the configuration
file, very odd.

Because of the feedback I received, I tried:
/*rsync_long_args <tab> --par1 <space> --par2 <space> */
and it finally worked.

I think that the manual page and the default rsnapshot.conf must say
that the parameters for /*rsync_long_args */
should be first separated by a <TAB> and the parameters with <SPACES>,
or rsnapshot should handle the tabs.

*Anyway: thank you very much for your help! **rsnapshot is a nice tool!!!*

Roy
Post by David Keegel
Roy,
The first thing I would look at is whether --relative is included
in your rsync arguments. With loglevel 3 (which is default) the
rsync command will be logged to the log file, if you want to check.
You can make rsync_long_args explicit in case by default host A's
rsnapshot does not include --relative, by putting this in your
/etc/rsnapshot.conf (or whereever you put the config) :-
rsync_long_args --delete --numeric-ids --relative --delete-excluded
This should give you the behaviour of host B (the directory structure
of the source is replicated in the destination/backup directory).
Post by Roy Krikke
Hello,
I'm new to this mailing-list. Forgive me if I ask a question that has
been answered previously.
So whenever I use rsnapshot to backup different directories such as
/home/user_a/Maildir/ or /home/user_b/Maildir/ it backs them up but in
the folder specified to store the backups, it does not keep separate
folders for /home/user_a/Maildir/ /home/user_b/Maildir/, instead it
just dumps it all together in the hourly.x folder.
I have another rsnapshot config file that isn't doing this, the
difference is the version of rsnapshot and the OS installed on the
host. Why is it doing this and how can I fix it?
- FreeBSD 10.2-RELEASE-p8
- rsnapshot 1.4.0
- rsync 3.1.1Â protocol version 31
- Ubuntu 14.04.1
- rsnapshot 1.3.1
- rsync 3.1.0Â protocol version 31
retain         hourly 24
#cmd_cp      /bin/cp
# Mail server host.lan
it does not keep separate folders for /home/user_a/Maildir/ andÂ
/home/user_b/Maildir/, instead it just dumps it all together in theÂ
hourly.x folder.
retain         hourly 24
#cmd_cp      /bin/cp
# Mail server host.lan
host.lan/home/user_a/Maildir/
host.lan/home/user_b/Maildir/
it does keep separate folders for /home/user_a/Maildir/ and
/home/user_b/Maildir/, so nice different directories/sub directories in
hourly.x folder.
- Ubuntu 14.04.1
- rsnapshot 1.3.1
- rsnapshot.conf (snapshot)
retain         hourly 24
cmd_cp      /bin/cp
# Mail server host.lan
it does keep separate folders for /home/user_a/Maildir/ and
/home/user_b/Maildir/, so nice different directories/sub directories in
hourly.x folder.
Why is the behavior of host a and host b different and how can I fix it?
Thank,
Roy
Loading...