diff --git a/Program.fs b/Program.fs
index 34425b801ab38f62344ee7139c2a28f8d09919da..d0a1b3631f1a33b578f910a4b0866a4729d48e25 100644
--- a/Program.fs
+++ b/Program.fs
@@ -206,9 +206,9 @@ exception PrivateKeyNotFoundException of string
let addOptionsForRemoteBackup (rc: MbackupRuntimeConfig) (rsyncCmd: string list) =
let options = rc.Options
let sshExeFile = mbackupProgramDir + "rsync-w64/usr/bin/ssh.exe"
- let sshConfigFile = userHome + ".ssh/config"
- let sshKnownHostsFile = userHome + ".ssh/known_hosts"
- let sshPrivateKeyFile = options.GetResult(Ssh_Key, rc.Config.GetStrDefault "ssh-key" (userHome + ".ssh/id_rsa")) |> toMingwPath
+ let sshConfigFile = userConfigDir + ".ssh/config"
+ let sshKnownHostsFile = userConfigDir + ".ssh/known_hosts"
+ let sshPrivateKeyFile = options.GetResult(Ssh_Key, rc.Config.GetStrDefault "ssh-key" (userConfigDir + ".ssh/id_rsa")) |> toMingwPath
let sshPrivateKeyFileWin = toWinPath sshPrivateKeyFile
if not (File.Exists(sshPrivateKeyFileWin)) then
raise (PrivateKeyNotFoundException("ssh private key doesn't exist: " + sshPrivateKeyFileWin))
diff --git a/README.md b/README.md
index 9ada04fb1a4a56a0074d7e38d2dd1032521e83c9..7a29490abbcefa3439641ff4aa70d54a0a9a8ba6 100644
--- a/README.md
+++ b/README.md
@@ -90,6 +90,7 @@ Replace D:\backup with the dir you want to save backup files to.
To backup to remote ssh node, add config
target=user@somehost.example.com:/path/to/dir
+ # default ssh-key path is %programdata%\mbackup\.ssh\id_rsa
ssh-key=D:\path\to\id_rsa
Replace ssh-key path with your ssh private key. Since mbackup is designed to
diff --git a/mbackup.fsproj b/mbackup.fsproj
index 38ffea7cc61e4ce25794585f78b51011b041bb00..c06723e7b09a78c623d49529d1e3ce8709c76ab9 100644
--- a/mbackup.fsproj
+++ b/mbackup.fsproj
@@ -23,7 +23,7 @@
win10-x64
Mbackup
true
- 0.5.3.0
+ 0.6.0.0
diff --git a/mbackup.wxs b/mbackup.wxs
index cb51c890910d277d6c24d007e100dc5a96b6f1bb..c62400891b5ec2f95349eee02209f28d30e78237 100644
--- a/mbackup.wxs
+++ b/mbackup.wxs
@@ -24,14 +24,16 @@
-
+
-
+
+
+
@@ -45,29 +47,33 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/operational b/operational
index 4706149b39ad098ac0e5d46fd83eba29d81a8779..a2323db730caa3cba7972511f87f3e17eb31a6d5 100644
--- a/operational
+++ b/operational
@@ -143,6 +143,9 @@ C:\ProgramData\mbackup\local-exclude.txt
- optional user configs
C:\ProgramData\mbackup\local-list.txt
C:\ProgramData\mbackup\local-exclude.txt
+ C:\ProgramData\mbackup\.ssh\id_rsa
+ C:\ProgramData\mbackup\.ssh\config
+ C:\ProgramData\mbackup\.ssh\known_hosts
- auto create these two files if they do not exist on target node.
never overwrite existing file.
@@ -244,16 +247,6 @@ vscode should at least always indent using space for F#.
**
** 2019-11-19 allow local Users group to have full access to local list and local exclude file.
by default, only admin can modify them, Users can only read/execute them.
-** 2019-11-19 drop the mbackup-logon task.
-it never runs.
-
-- problem
- - why it never runs?
- if it runs fine, I would rather keep this task.
-
-** 2019-11-18 get a simple web page up to host the msi file.
-see URL in README.md
-serve msi from apt.emacsos.com CDN.
** 2019-11-18 add dockerfile to create rsync mingw64 distribution,
then update Makefile and wix xml files to use that.
@@ -266,6 +259,34 @@ Are there any code change required?
** 2019-11-18 add log rotate for %localappdata%\mbackup\mbackup.log
* done :entry:
+** 2019-11-23 update ssh config file path.
+don't use ~/.ssh/
+use %programdata%/mbackup/.ssh instead.
+
+because mbackup is run for current user when run in Task Scheduler and in cmd.exe.
+the ssh key and known hosts file should be shared.
+
+use current user's home dir would require copy the files to everywhere and recreate known
+hosts file every time. Share a single .ssh config dir makes more sense.
+
+- problems
+ - can I create an empty .ssh dir when msi installer runs?
+ if not easy, I will just add an empty ssh config file.
+
+** 2019-11-18 get a simple web page up to host the msi file.
+see URL in README.md
+serve msi from apt.emacsos.com CDN.
+
+it's published in my blog.
+
+** 2019-11-19 drop the mbackup-logon task.
+it never runs.
+
+- problem
+ - why it never runs?
+ if it runs fine, I would rather keep this task.
+ I have seen it run successfully. just not every time when I logon.
+ I will keep the task.
** 2019-11-18 apply gpl.
rsync is gplv3. I will apply gplv3.
** 2019-11-12 make code work in a specific dir. then create an installer.