ローカルのパス
C:\Users\negla\Documents\vps\ObsidianExport\blog
C:\Users\negla\Documents\vps\ObsidianExport\lib
↑こう書くか/こう書くか↓
/c/Users/negla/Documents/vps/ObsidianExport/blog
/c/Users/negla/Documents/vps/ObsidianExport/lib
サーバーのパス
/home/negla/html/www/app/public/blog
/home/negla/html/www/app/public/lib
※ public 直下には他にも色々なファイルがあるので ObsidianExport と public とでの同期はしない
> rsync -avz -e "ssh -p {port-no} -i {path/to/key}" {from-path} {username}@{host}:{to-path}
その前に rsync が使えるようにしなきゃだった。
> choco install rsync
Do you want to continue?([Y]es/[N]o): Y
Installing the following packages:
rsync
By installing, you accept licenses for the packages.
<その後エラー表記>
Cmderを管理者権限で開いてリトライ
> choco install rsync
Chocolatey v2.2.2
Installing the following packages:
rsync
By installing, you accept licenses for the packages.
rsync v6.3.0 [Approved]
rsync package files install completed. Performing other installation steps.
The package rsync wants to run 'chocolateyInstall.ps1'.
Note: If you don't run this script, the installation will fail.
Note: To confirm automatically next time, use '-y' or consider:
choco feature enable -n allowGlobalConfirmation
Do you want to run the script?([Y]es/[A]ll - yes to all/[N]o/[P]rint): A
Extracting C:\ProgramData\chocolatey\lib\rsync\tools\cwrsync_6.3.0_x64_fr
C:\ProgramData\chocolatey\lib\rsync\tools
ShimGen has successfully created a shim for rsync.exe
The install of rsync was successful.
Software installed to 'C:\ProgramData\chocolatey\lib\rsync\tools'
Chocolatey installed 1/1 packages.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
できたかな。
> rsync -avz -e "ssh -p 22 -i {path-to-pem-file}" /c/Users/negla/Documents/vps/ObsidianExport/blog negla@ cigneg.com:/home/negla/html/www/app/public/blog
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: error in rsync protocol data stream (code 12) at io.c(228) [Receiver=3.2.3]
rsync: connection unexpectedly closed (0 bytes received so far) [sender]
rsync error: error in rsync protocol data stream (code 12) at io.c(231) [sender=3.3.0]
うーんうまくいかない。
fromのディレクトリをWindows形式で書くと「送り元と送り先の両方をリモートとすることはできない」というエラーが出る。ローカルなのに。/c/...の書式にしていると上記のエラー。
一回消しておくか。他の手段を考えた方が早いかもしれない。
> choco uninstall rsync
Chocolatey v2.2.2
Uninstalling the following packages:
rsync
rsync v6.3.0
Skipping auto uninstaller - No registry snapshot.
rsync has been successfully uninstalled.
Chocolatey uninstalled 1/1 packages.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
マウントしている状態から public フォルダを直接指定して Export し、同期は Mountain Duck にお任せする。