8

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.

Organic Marble
  • 23,641
  • 15
  • 70
  • 122
  • 2
    By "missing files" do you mean files you've sent to the trash? Where do you see this option in Nautilus? – DK Bose Sep 01 '19 at 15:25
  • @DK Bose I am unable to screenshot it, but when you right-click in a folder in Nautilus, one of the options in the context menu is "Restore missing files..." What this seems to do is start deja-dup and compare the current contents of the directory with what is in your backups. A list of the files in the backup but not in the directory is generated and you can tick the boxes for the ones you want to restore. It's useful for absent minded characters like me who can't remember the exact filename. – Organic Marble Sep 01 '19 at 15:34
  • 1
    The codesearch says that it is Deja Dup Nautilus extension. 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. – N0rbert Sep 01 '19 at 15:36
  • Okay, so it's related to deja-dup. Thanks for clarifying. (You should be able to screenshot context menus, dropdowns, etc using scrot: scrot -d according to man scrot.) – DK Bose Sep 01 '19 at 15:37
  • 2
    @N0rbert useful link: codesearch. Bookmarked! – DK Bose Sep 01 '19 at 15:40

2 Answers2

11

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

N0rbert
  • 99,918
4

Once again --- posting the question led me to find the answer.

When I edited the question and wrote "Perhaps it's a command that Nautilus sends to deja-dup" .... sure enough,

deja-dup --restore-missing DIRECTORY

Farewell Nautilus!

Organic Marble
  • 23,641
  • 15
  • 70
  • 122