Ubuntu – How to have the “Restore Missing Files” function from Nautilus without installing Nautilus

deja-duplubuntunautilus

I find the "Restore Missing Files" function in Nautilus very useful. In fact, it's literally the only reason I have Nautilus installed! (I typically use Lubuntu or at least LXDE)

enter image description here

Today I was wanting to use this function on a pc that didn't have Nautilus installed…raising the question of…

Is there a way to have the same easy functionality of restoring missing files from a directory that Nautilus provides, without installing Nautilus (or another "extra" file manager)? I don't insist on a GUI though that would be nice. Perhaps it's a command that Nautilus sends to deja-dup.

Best Answer

The codesearch says that it is Deja Dup Nautilus extension.

It has its code on LaunchPad and deja-dup is called from NautilusExtension.c file:

cmd = g_strdup_printf("deja-dup --restore-missing \"%s\"",
                   nautilus_file_info_get_uri(info));

g_spawn_command_line_async(cmd, NULL);

It is also known that Caja has integration with Deja Dup too via deja-dup-caja package.
So you can use Caja with this extension.

Theoretically we can try to write our extension with FileManager Actions or something similar to have this in context menu.

The complete method is the following - we need to create user-action file and place it in special folder (the method is based on this answer) :

mkdir -p ~/.local/share/file-manager/actions
cat > ~/.local/share/file-manager/actions/deja.desktop << EOF

[Desktop Entry]
Type=Action
Tooltip=Restore Missing Files
Name=Restore Missing Files
Profiles=profile-zero;
Icon=deja-dup

[X-Action-Profile profile-zero]
MimeTypes=inode/directory;
Exec=deja-dup --restore-missing %u
Name=Default profile
EOF

and use it:

Restore Missing Files in PCManFM

Related Question