linux マシンが 2台あれば,rsync で良いのだけれど,ない場合には工夫がいる.
日常使いのPC→Win
サーバー→Linux
Winは使う時だけ起動
の前提の時,こんな風にしてみた.
linux マシン
crontab で zip を走らせる(etc var home を圧縮)
zip -P password -rq /tmp/etc.zip /etc
みたいな感じ。
mysql もバックアップ。
mysqldump | gzip > hoge.gz
Win マシン
C:> Winscp.com /script=scriptfilename open username@hostaddr -privatekey=ppkfile.ppk cd /remote_directory lcd c:\local_directory get etc.zip var.zip home.zip hoge.gz .\ exit
タスクスケジューラで,Winscp.com のコマンドを書いた bat ファイルを実行.