On Thursday 15 December 2005 09:24, Yngve Johansson wrote:
> I'm having problems with ownership and permission of directories after
> restoring files.
>
> Example:
>
> I restored the file /sw/local/sbin/test.txt from tape (a full backup)
> to my home directory (where=/home/yngjo) and using replace=ifnewer.
>
> The file is restored to /home/yngjo/sw/local/sbin/test.txt, so far so
> good.
> But the problem is that directory entries /home/yngjo/sw,
> /home/yngjo/sw/local and /home/yngjo/sw/local/sbin are all getting wrong
> ownership and permissions.
>
> >From the Bacula log I can see that it restores the file
>
> /sw/local/sbin/test.txt first (because it is found before directory
> entries on the tape). I guess it, at that point, creates the parent
> directories (sw/local/sbin) using some rule. When Bacula later finds the
> parent directories on tape, the directories already exists with a newer
> timestamp on disk, and they will not be restored from tape.
>
> If I use "replace=always" then all parent directories are restored, but
> that's not what I want.
>
> Am I right? Is there anything I can do fix the problem?

Yes, I think you have analyzed the problem quite well.

Perhaps a solution is that when Bacula is creating a non-existing directory 
and the replace=ifnewer is set, it can create the directory with a date of 0 
(i.e. 1/1/1970) and thus when the real directory record is found at the end 
of all the files, it will also be updated.  The problem is that the directory 
entry is probably updated everytime a file is written in it.  If that is the 
case, the only way to handle this correctly would be for Bacula to remember 
what directories it creates, in a list, then when the actual directory record 
is found for restoration, it could reset the correct values ...

Whatever the solution is, it seems to me that it is a non-trivial exercise.  
Perhaps this problem could be wrapped into project 3 Accurate restoration of
renamed/deleted files.  I've made a note to that effect.

>
>
> Regards
> Yngve
>
>
>
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc. Do you grep through log
> files for problems?  Stop!  Download the new AJAX search engine that makes
> searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
> http://ads.osdn.com/?ad_idv37&alloc_id865&opÌk
> _______________________________________________
> Bacula-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/bacula-users

-- 
Best regards,

Kern

  (">
  /\
  V_V


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Bacula-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to