Ubuntu: Graphical tar File Management

I have a process that backs up some specific directories with GNU tar. For restores, I've been using the GNU tar command as well, and everything works perfectly. owner:group and perms are restored exactly as originally archived as long as the restore is done by root.

GUI archive managers (I've tried File-Roller, Ark, and Peazip) do not restore the original owner:group and in some cases even the permissions aren't right. It doesn't matter if root runs them or not.

For example, if I have a directory /home/foo, and it is owned by foo:bar, when I restore it with File-Roller (GNOME), using root, it is owned by root:sys. This breaks what I was hoping to achieve: an easy way for some of my users to restore files graphically. This isn't a huge issue, as I can document the procedure to restore from the shell prompt with GNU tar, but it would give them what they were more accustomed to with their old GUI based backup software. (tar is a must since we're going across *nix platforms and I wanted something ubiquitous and easy to work with, which GNU tar is).

I did post a question on the GNOME forum as well, to see if there is some hidden option to restore owner:group with File-Roller, but figured I would check in here first in case anyone else has run into this and found a solution. I know that I could use stat to collect the owner:group and perm information to a separate file and potentially find a way of using that to restore that information over top of the GUI restored files, but that might complicate things a bit for the users, more than I would prefer.

Currently, I am assuming it's not possible to restore owner:group with any of the GUI based applications. Ark (KDE) was similar but did have a nicer UI that was more like their old backup software. Peazip (I used a portable version) was too convoluted and didn't like the file names containing ':' characters. I have not tried any other GUI managers, and was unable to find any GNOME Nautilus/Files plugins to allow for "mounting" the tar files as file systems.

I might investigate some Fuse file system options for tar if all else fails.

Update: Just had a chance to try and was reminded that one limitation of Fuse is that it is user space, so whichever user mounts the tar file, will own ALL files and dirs in the archive. If anyone is curious, I tried fuse-archive from Google built from source. It has a 'allow_root' option but even then, everything is owned by root:sys instead of preserving original ownership.

you could configure an entry in the sudoers file to allow --same-owner switch if the user specifically wants to preserve ownership ....

obviously need to test that ...

The tar command when run as root will by default restore the attributes from the tar file.

Is your tar backup okay?
Check the stored attributes with

tar tvf tarfile

Run the file-roller as root with strace on exec:

strace -fe execve file-roller

How does it run tar?
If it does not run a helper like tar then it's all built in, look for a preference/setting/option.

Using the 'tar' command itself running as root works exactly as I want. However, I'm looking for a way for less technical users to use a GUI as they would in Windows to do their file restores. The GNOME archive manager, Fileroller, doesn't follow this way of restoring and it doesn't appear to be a GUI wrapper around the 'tar' command. Looking through all the preferences in the GUI application there are no options to allow restore owner:group.

Since the people at the GNOME project have not provided any responses, I'm thinking I'm asking for something that the Fileroller GUI can't do. The others (KDE Ark and PeaZip) I've tried are pretty much the same, as explained above. No options to restore owner:group. I'm thinking that the concept might be, if someone is using a GUI utility to restore from tar, they might not be knowledgeable enough to avoid damaging their systems if they run it as root.

For the time being I've written up instructions for the users on doing 'tar' restores from the CLI.

@deckard , did you look into the sudoers option ?

you would [probably] need to write a 'window' wrapper around the command ....

Thanks munkeHoller. Sadly, it doesn't appear there is anywhere in Fileroller to provide any kind of tar arguments. I think they are using a library and not wrapped around the tar command itself. The preferences are pretty barren too. For now, my users will have to deal with using the CLI unless we run into an issue with that style of restore.

1 Like