Windows file Backup to linux:windows Timer task +cwrsync+ssh password-free authentication

Source: Internet
Author: User

First, install the Cwrsync

II. create a key pair to enable SSH password-free authentication

On a Linux server

[Email protected] ~]# ssh-keygen generating Public/PrivateRSA key pair. Enter fileinchWhich to save the key (/root/.ssh/Id_rsa): # # #回车Created Directory'/root/.ssh'. Enter Passphrase (Empty forno passphrase): Enter same passphrase again: # # #回车Your identification has been savedinch/root/.ssh/Id_rsa. Your PublicKey has been savedinch/root/.ssh/id_rsa.pub.The Key Fingerprint is: # # # #回车fc: the: -: the: Fd:d4:7f:3b:e7: the: the: ed:e2:c0:a9: -[email protected]the key's Randomart image is:+--[RSA2048]----+|                 ||                 ||       ||         .        ||       S | | . + .      O | | o = E *.       o| | =   * ..          =*|| . ...*@|+-----------------+

[Email protected] ~]# Ssh-copy-id [email protected]
The authenticity of host ' localhost ' (:: 1) ' can ' t be established.
ECDSA key fingerprint is e5:07:2a:f0:9f:c5:df:64:70:61:6a:7a:31:bf:21:7a.
Is you sure want to continue connecting (yes/no)? Yes
/usr/bin/ssh-copy-id:info:attempting to log in with the new key (s), to filter out any that is already installed
/usr/bin/ssh-copy-id:info:1 key (s) remain to being installed--if you are prompted now it's to install the new keys
[email protected] ' s password:

Number of key (s) added:1

Now try logging to the machine with: "SSH" [email protected] ' "
And check to make sure that is only the key (s) wanted were added.

[[email protected] ~]# ls. ssh/
Authorized_keys Id_rsa id_rsa.pub known_hosts
########## #将id_rsa下载到本地

Iii. Editing Remote Copy Scripts

SETLOCAL Set Cwrsynchome=D:\cwRsync # # # #cwrsync安装路径 set HOME=D:\cwRsync ##### #服务器密钥rd_rsa路径 , my path is D:\cwRsync\.ssh set Cwoldpath=%path% set path=%cwrsynchome%\bin;%path%
CD D:\cwRsync\bin
Rsync-avz--delete/cygdrive/d/test [Email protected]:/tmp ######/cygdrive is the path format, my actual path is d:/test.
######## #首次运行脚本需要手动输入一次密码 ########

Four, timed operation

    • Create a basic task

    • Create triggers, task execution conditions

    • Specific execution time

    • What to do when a condition is triggered

    • If you are opening a program, run the script, select the program, script path

Windows file Backup to linux:windows Timer task +cwrsync+ssh password-free authentication

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.