gkiefer/backup2l

Ignore permissions and ownership on restore

Closed this issue · 2 comments

Hi,

I am running backup2l via cygwin on Windows and it works well (I have to use the latest 1.6-pre2 for a problem in 1.5 that I now forget)

I had a situation recently where I was attempting to perform a restore onto a new laptop and the ownership and permissions basically failed badly. I presume this has more to do with cygwin's permission management than anything else.

For the content I was backing up, not having the permissions was not really problem - the content is most important.

For the actual files themselves I can override the DRIVER_TAR_GZ and remove the --same-permission --same-owner arguments for tar at :

tar zx --same-permission --same-owner -f $3 -T $4 2>&1

But there is not anything I can do for the directories:

backup2l/backup2l

Lines 1012 to 1013 in 071ce97

eval "$FILTER_CHMOD" < $BACKUP_DIR/$TMP.dirs | xargs -l1 chmod
eval "$FILTER_CHOWN" < $BACKUP_DIR/$TMP.dirs | xargs -l1 chown

I was thinking that if these 3 lines where extracted to a separate function, then that function could be overridden in the conf file if required.

thanks

Something like this (not tested!) change:
blair-robertson@36c9e78

What exactly does "fail badly" mean? I can imagine two solutions:

a) Add a configuration option like RESTORE_ATTRS=[1|0, default=1] , which deactivates the mentioned two lines if set to 0.

b) Rephrase the lines so that they fail silently in case of problems (would not require a new option).