resticprofile icon indicating copy to clipboard operation
resticprofile copied to clipboard

Can't use env in `source-base`

Open zumm opened this issue 5 months ago • 2 comments

When using env in source-base on Windows, like that:

default:
  backup:
    source-base: $HOME
    source-relative: true

It fails with error:

2025/07/27 11:58:35 backup on profile 'default': chdir $HOME: The system cannot find the file specified.

It also fails with other env (like $PWD) and with "~/".

Same env works fine for base-dir:

default:
  base-dir: $HOME
  
  backup:
    source-relative: true

zumm avatar Jul 27 '25 05:07 zumm

I have to admit I forgot how $HOME is resolved on Windows.

It's going to be a trick to convert it to %USERPROFILE% for cmd, and maybe something else for powershell to make things simple 😆

Kicking off half a day of Windows updates as we speak 🙄

creativeprojects avatar Jul 28 '25 15:07 creativeprojects

#568 is related. {{ .Env.HOME }} at least works, but in an unexpected way for schedules.

anacierdem avatar Oct 19 '25 11:10 anacierdem