Bug 18399

Summary: rsnapshot removing / from end of directories
Product: Mageia Reporter: w unruh <unruh>
Component: RPM PackagesAssignee: All Packagers <pkg-bugs>
Status: RESOLVED WONTFIX QA Contact:
Severity: normal    
Priority: Normal CC: laidlaws, marja11
Version: 5   
Target Milestone: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Source RPM: rsnapshot CVE:
Status comment:

Description w unruh 2016-05-07 22:27:41 CEST
Description of problem:
rsync, if the directory ends in /, the directory itself is trasfered while if the directory does not end in /, the contents of the directory is transfered. 
rsnapshot uses rsync. In rsnapshot I have
backup  /etc/   boson-etc/
which should transfer the contents of the /etc directory to the directory boson-etc. However, rsnapshot actually runs

/usr/bin/rsync -ax --delete --numeric-ids --relative --delete-excluded --exclude=**/core.[0-9]* /etc /backup/daily.0/boson-etc/
Ie, it removes the / from the end of /etc. This means that now one has

/backup/daily.0/boson-etc/etc/<contents of etc>
instead of 
/backup/daily.0/boson-etc/<contents of etc>

This happens on all local directories. Thus if I have the line
backup /home/unruh/ unruh-home
I get
/daily.0/unruh-home/home/unruh/<contents of /home/unruh>
rather than
/daily.0/unruh-home/<contents of /home/unruh>
as it used to do. 

This new behaviour seems to have started around the end of 2013.




Version-Release number of selected component (if applicable):
rsnapshot-1.3.1-12.mga5

How reproducible:
Always


Steps to Reproduce:
See above
Comment 1 Marja Van Waes 2016-05-08 10:49:28 CEST
Assigning to all packagers collectively, since there is no maintainer for this package.

CC: (none) => marja11
Assignee: bugsquad => pkg-bugs

Comment 2 Doug Laidlaw 2016-10-23 11:31:01 CEST
Is the assumption correct, Bill?  I found this bug while seeing if my current one already existed.

rsnapshot doesn't back up between directories.  It backs the two directories up to daily.0.  My version backs up /usr/local as part of /usr, and again because I have a separate line to back up /usr/local.  That is what the rsnapshot docs say it should do.  man rsnapshot will give you the correct syntax.  Final slashes are required by rsnapshot, regardless of what rsync usage is.

In other words, rsnapshot won't back up /etc to /boson-etc, then back the updated boson-etc to daily.0.  If that is what you want it to do, you need to run a separate script immediately before rsnapshot, to put boson-etc in the state it has to have before it is handled by rsnapshot.

If rsnapshot isn't behaving like rsync, that is an upstream bug.  The developer's details are in the documentation, and he has a detailed Web site.  But my feeling is that rsnapshot behaves identically to rsync only where the docs expressly say so.

CC: (none) => laidlaws

Comment 3 Doug Laidlaw 2016-10-23 12:54:00 CEST
You can check your syntax with:

# rsnapshot configtest

Mine tested O.K.

(From the ArchLinux wiki, a veritable goldmine of command-line info.)
Comment 4 w unruh 2016-10-23 14:02:24 CEST
I believe they changed the behaviour of rsnapshot. around 2013. with a trailing / it used to save the contents to the destination. Now it saves the directory tree.
This can be a pain. If I want to save /usr/local/data/critical/unruh/stuff I do not want that whole tree, but just the "stuff" 
But as you say, it is probably true that this change was made by upstream with malice aforethought and there will be nothing Mageia can do.
Comment 5 Doug Laidlaw 2016-10-23 14:15:54 CEST
Now you are talking like somebody else I could mention.  "They changed it in 2013.  I want it how it was."

You can do what you say by making /usr/local/data/critical/unruh/ the directory in the left hand column, and "stuff" in the right hand column, provided "stuff" is a directory.
Comment 6 Doug Laidlaw 2016-10-23 15:31:37 CEST
(In reply to w unruh from comment #4)
> But as you say, it is probably true that this change was made by upstream
> with malice aforethought and there will be nothing Mageia can do.

Mageia can't go out on its own, and have a version of rsnapshot different from everybody else's.  What you are really making is a feature request, and those get bottom priority.  The team don't have the time.  The last time I made one, I was told to do it myself.

In your last example, the columns probably won't line up.  I have one of those.  It doesn't matter. Separate the two fields by one or more tabs, and no spaces, 
and layout is irrelevant.

An end-of-line backslash will work, but I wouldn't use it here.

If you need to run a script, as I suggested originally, I believe (without looking) that it can be done.  man rsnapshot tells you how.
Comment 7 w unruh 2016-10-23 16:17:36 CEST
I have had to remind myself of the problem.
I have as an example, two lines in rsnapshot.conf
backup  rsync://info/etc/       info-etc/
backup  /etc/   boson-etc/   
Ie, I want the contents of the /etc directories to be stored in <computername>-etc
In the first case, it is a remote system and the contents of /etc are stored in info-etc. In the second case, a local directory, the contents get stored in boson-etc/etc/
Now, I could just do 
backup    rsync://boson/etc/      boson-etc/
and it would do what I want. The two boson lines used to be identical in their behaviour. When they switched suddenly I got duplication, I had old content in 
boson-etc/ and newer content in boson-etc/etc/, doubling the storage. I never noticed this until recently when I complained about it.
Anyway, I can live with the inconsistency, it is designed to operate in this way by upstream, so I guess this should be closed with a WONT FIX.
Comment 8 Doug Laidlaw 2016-10-23 16:30:45 CEST
So you copy info/etc on the system into info-etc in the backup.

The command 
backup    rsync://boson/etc/      boson-etc/

puts boson/etc into boson-etc in the backup.

You will need to nut it out.  My system is far simpler.

Personally, I think that the bug report is invalid, because rsnapshot is working as intended.  It isn't a case of the bug won't fix; it isn't a bug.  But the important thing is to close the bug.  WONTFIX will do.
Comment 9 Marja Van Waes 2018-05-03 07:46:53 CEST
Closing as WONTFIX as suggested by the reporter, w unruh, and by Doug, the only other commenter.

@ w unruh

As the reporter of this bug, you should have been able to close it.

Resolution: (none) => WONTFIX
Status: NEW => RESOLVED

Comment 10 Doug Laidlaw 2018-05-03 10:42:58 CEST
Thanks, Marja.  I think that unruh may have been expecting the switches for rsync to work everywhere, without modification (reasonable.)  rsnapshot has its own man page, and instructions for specifying directories are there and in the config file.  If they differ from rsync, they still prevail.  In that case (if correct) the bug should be invalid.

I am on too many bug reports.  I talk too much.