Restic on linux does not seem to work with script

Hi. I was trying to use restic on linux using script like this:

script -c "restic -p <password file> backup <parameters> " backup.log

but nothing was ever written to the log and using lsof, I did not see restic using that file. The backup I want to do is quite long and I want to do it in a batch job, but keep track as to how its goung by looking at the log. On the mac, it does work.

Thanks in advance for any suggestions.

Hm, that’s odd. I’ve just tried it and it worked well. How did you view the output file? It will contain many escape sequences which, if printed via cat backup.log, will probably not be visible on the local terminal. Can you try less?

OK, I found that using the -f option to script has solved this problem, however I am having another problem and that is, that my excludes are not working properly – I have an exclude written like this:
‘/proc/*’ and yet it was trying to scan the /proc directory.

Am I using the wrong format or what?


--exclude='/proc/*' tells restic to ignore all of the contents of /proc, however the glob is matched against every scanned path to determine if it should be excluded. Therefore, restic will scan /proc and test each node against the pattern, then discard each as excluded.

--exclude=/proc would be better, as it will skip the directory completely.

--one-file-system would be best as it will avoid descending into any filesystems you haven’t explicitly listed. This is particularly useful since distros seem to add more virtual filesystems to the standard set of mounts every day.

I saw a thread which seemed to indicate that I should remove the ’
character as it would use a literal * and not a real filename. When I
did that it seemed to work better, but its still going, so hard to
tell yet.

You want restic to see a literal *. Otherwise it gets expanded by your shell and does NOT do what you want it to do at all.

I am using an exclude file, is this still true? One thing also, I
want directories like proc to be there, just not the contents.

In an exclude file you should not use quotes, no.