Even though I usually avoid using GUIs for recoveries*, given my main workstation is a Mac, I don’t have the option of using a NetWorker GUI for personal recoveries anyway.

Over time I’ve become one of those users that many Unix sysadmins dislikes – I name files and folders with prefixes including:

-

*

and

#

Heck, I even use ? and ? as directory prefixes.

It caught me by surprise then when I tried to recover a directory called “-Proposal”. My natural inclination was to go to the parent directory of “-Proposal” and type:

recover> add -Proposal

usage: add [-q] [filename] – add `filename’ to list of files to be recovered

As you can see, that didn’t particularly work.
Nor did the following:

recover> add — -Proposal

usage: add [-q] [filename] – add `filename’ to list of files to be recovered

Nor did:

recover> add ‘-Proposal’

usage: add [-q] [filename] – add `filename’ to list of files to be recovered

As you can imagine, it was starting to get a little bit frustrating.

To cut a long story short, in a scenario where you need to recover a directory that starts with a dash, you need to do something along the lines of the following:

  1. If the directory still exists, change into that directory in the shell, and run recover from there, or
  2. Add the parent directory, then exclude the files/directories you don’t need recovered, or
  3. If the directory doesn’t exist, make the directory, change into that directory in the shell, and run recover from there.

None of these are ideal solutions, but they do work. I hope, if you need to recover such a directory, you manage to stumble across this tip or you remember it – there are few things worse than worrying that something you really need to recover seems an impossibility.


* If you can’t turn off a file-by-file selection when you’re adding 10,000,000 files, a GUI is painful.

© 2012 The NetWorker Blog Suffusion theme by Sayontan Sinha