rdiff-backup-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [rdiff-backup-users] [PATCH] Support for backing up paths with trail


From: Dominic
Subject: Re: [rdiff-backup-users] [PATCH] Support for backing up paths with trailing slashes on Windows
Date: Thu, 27 Nov 2008 17:51:35 +0000
User-agent: Thunderbird 2.0.0.18 (Windows/20081105)

Josh Nisly wrote:
The problem this fixes is most evident when trying to back up an entire drive e.g. C:\, but the same problem occurs whenever there is a trailing slash in the path. The issue is that rdiff-backup has support for using \ as a way of escaping characters in the path specifier. This is all fine and common on unix, but on Windows, the \ is obviously used as a path separator. (There really is no way of escaping characters like this on the Windows command line. It is expected that you simple quote everything.) This patch simply disables escaping if the path separator is a \.

This does remove some functionality: if you are backing up from Windows to linux, you could have escaped the remote side of the connection, and with this patch you can't. However, you can still quote the remote path, and I believe that it's more important to allow trailing slashes, especially with drive specifications, than supporting escaping for the remote path.

(This problem was first reported here: http://lists.gnu.org/archive/html/rdiff-backup-users/2008-08/msg00051.html.)
The patch is helpful I am sure, but a fairly simple workaround for the \ issue on Windows XP or higher is, if running rdiff-backup from a command script (.cmd or .bat), set a variable to the the path(s) and then use the variable character replacement capability (do SET /? for info) e.g:

C:\>echo %USERPROFILE%
C:\Documents and Settings\Dominic

C:\>echo %USERPROFILE:\=/%
C:/Documents and Settings/Dominic

By processing all paths in this way in a command script as or before they are passed to the rdiff-backup command line the problem should disappear I think. But each full path must be allocated to a variable for this to work (I cheated above by using a built-in system variable). (As it so happens in this example there is no trailing forward slash but you get the idea.)

Dominic




reply via email to

[Prev in Thread] Current Thread [Next in Thread]