I use a command like btrfs restore -iv /dev/sdc1 /RESTORED

estimated time of running it is few days

In every hour of running I see a lot of prompts like:

We seem to be looping a lot on /path/to/some/file, do you want to keep going on?

I'd like to say N to all remaining prompts, but there is no such option (according to man btrfs-restore and btrfs )

I think I need this: yes N | btrfs restore -iv /dev/sdc1 /RESTORED (which will start restore again)

Is any way to pause a running task (not cancel) and then resume within a pipe like

ctrl+Z + $ yes N | fg

(the above return fg no job control). fg here is only to show what I mean.

  • Interesting question, but I don't think it is possible to redirect standard input on the fly. One work around could be to use xdotool or xvkbd to simulate repeatedly pressing N. A script doing that could be launched with a shortcut key when the command is running and starts to ask confirmations.
    – vanadium
    Commented Jun 27, 2021 at 14:28
  • This is really a job for expect.
    – muru
    Commented Jun 27, 2021 at 15:17

1 Answer 1


I found a workaround like this:

simply I generated a list of N (for example by yes N)

copied that and paste into running task

It is of course limited, so in my case, I've copied 10K lines of N.

the list must be with a single N per line.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .