windows文件备份到linux:windows定时任务+cwrsync+ssh免密码认证
一、安装cwrsync






二、创建密钥对,实现ssh免密码验证
linux服务器上
[root@zabbix ~]# ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/root/.ssh/id_rsa): ###回车 Created directory '/root/.ssh'. Enter passphrase (empty for no passphrase): Enter same passphrase again: ###回车 Your identification has been saved in /root/.ssh/id_rsa. Your public key has been saved in /root/.ssh/id_rsa.pub. The key fingerprint is: ####回车 fc::::fd:d4:7f:3b:e7:::ed:e2:c0:a9: root@zabbix.suffergtf.com The key's randomart image is: +--[ RSA ]----+ | | | | | | | . | | S | | . + . o | | o = E * . o| | = * ..=*| | . ...*@| +-----------------+ [root@zabbix ~]# ssh-copy-id root@localhostThe 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.Are you sure you 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 are already installed/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keysroot@localhost's password: Number of key(s) added: 1 Now try logging into the machine, with: "ssh 'root@localhost'"and check to make sure that only the key(s) you wanted were added. [root@zabbix ~]# ls .ssh/authorized_keys id_rsa id_rsa.pub known_hosts###########将id_rsa下载到本地
三、编辑远程copy脚本
SETLOCAL SET CWRSYNCHOME=D:\cwRsync ####cwrsync安装路径 SET HOME=D:\cwRsync ######服务器密钥rd_rsa路径,我的路径为D:\cwRsync\.ssh SET CWOLDPATH=%PATH% SET PATH=%CWRSYNCHOME%\BIN;%PATH% cd D:\cwRsync\bin rsync -avz --delete /cygdrive/d/test root@192.168.127.250:/tmp ######/cygdrive是路径格式,我的实际路径为d:/test。#########首次运行脚本需要手动输入一次密码########
四、定时运行
- 创建基本任务

- 创建触发器,任务执行条件

- 具体执行时间

- 触发条件后需要做哪些操作

- 如果是打开程序,运行脚本,请选择程序、脚本路径

windows文件备份到linux:windows定时任务+cwrsync+ssh免密码认证的更多相关文章
- ssh免密码认证
举例:有机器PC_A(172.0.246),PC_B(172.0.1.140).现想A通过ssh免密码登录到B. 1.在PC_A主机下生成公钥/私钥对 [comodo@PC_A ~]$ ssh-key ...
- SSH 免密码认证登陆
检查是否已安装ssh rpm -qa |grep ssh 如未安装可以重新安装 yum install -y openssl openssh-server 修改配置 vim /etc/ssh/ssh ...
- linux下设置了SSH免密码登录但还是需要输入密码的解决办法
今天在设置linux的免密码登录后,仍然需要输入密码,后来找到了原因,是因为用户没有权限修改.ssh目录下的know_hosts文件导致的. 具体情况是这样的: 在/home/username/.ss ...
- Linux 服务器用户间ssh免密码登录
1.本脚本为服务器用户间密码互信登录脚本 2.依赖 需要安装expect工具 3.使用 sh CreateUserssh.sh hadoop hadoop /home/hadoop/.ssh 三个带入 ...
- 用expect解决批量Linux集群机器间SSH免密码访问
转自:http://blog.csdn.net/aichaoguy/article/details/11693269#!/bin/bash #check whether package 'expect ...
- linux 非root用户 ssh 免密码登录
之所以要把这个记录下来 是因为它的确和root用户不一样root用户 不需要改动什么权限问题 只要生成私钥/公钥对 即可 但是一样的操作在普通用户上就出了问题了 折腾了老半天 ssh-keygen ...
- Linux 配置ssh 免密码登录
在平常应用中,我们经常会登录到其他主机,比如说服务器,每次都需要用户名和密码. 我们可以通过ssh免密码登录服务器而不需要输入密码. 现在有一台ubuntu的阿里云服务器,称之为 server. 公 ...
- 【Linux】文件权限,ssh免密登录
1.文件/文件夹权限 例子: -rw-r--r--. 1 root root 12288 Aug 21 09:50 aliases.db drwxr-xr-x. 2 root root 4096 Au ...
- Linux下SSH免密码登录
转自:http://haitao.iteye.com/blog/1744272 ssh配置 主机A:10.0.5.199 主机B:10.0.5.198 需要配置主机A无密码登录主机A,主机B 先确保所 ...
随机推荐
- Luogu P1552 [APIO2012]派遣【左偏树】By cellur925
题目传送门 $Chat$ 哈哈哈我xj用dfs序乱搞竟然炸出了66分....(其实还是数据水,逃) $Sol$ 首先我们应该知道,一个人他自己的满意度与他子树所有节点的领导力是无关的,一个人的满意度受 ...
- iSCSI 原理和基础使用
终于完成最后一篇了,一上午的时间就过去了. 下文主要是对基本操作和我对iSCSI的理解,网上有很多iSCSI原理,在这里我就不写了,请自行学习. 这篇文章仅对iSCSI的很多误解做一次梳理,你必须对所 ...
- 为什么使用Stylus
CSS预处理器的出现大大的提高了前端开发的效率和逼格,它让CSS可编程化.LESS和Sass/SCSS是两种最为常见的预处理器,拥有大量的用户基数,数目庞杂的第三方库.然而,还有一种预处理器并未引起足 ...
- B.华华教月月做数学
链接:https://ac.nowcoder.com/acm/contest/392/B 题意: 找到了心仪的小姐姐月月后,华华很高兴的和她聊着天.然而月月的作业很多,不能继续陪华华聊天了.华华为了尽 ...
- 线段树(成段更新) POJ 3468 A Simple Problem with Integers
题目传送门 /* 线段树-成段更新:裸题,成段增减,区间求和 注意:开long long:) */ #include <cstdio> #include <iostream> ...
- 暴力 Codeforces Round #305 (Div. 2) B. Mike and Fun
题目传送门 /* 暴力:每次更新该行的num[],然后暴力找出最优解就可以了:) */ #include <cstdio> #include <cstring> #includ ...
- scau 17967 大师姐唱K的固有结界 分类暴力 + RMQ
由于能放两次,那么分类, 1.连续使用,(这个直接O(n^2)暴力) 2.分开使用. 分开使用的话,首先暴力枚举,用T时间,能从第1个位置,唱到第几首歌,然后剩下的就是从pos + 1, n这个位置, ...
- Windows下降权MYSQL和apche的运行级别(普通用户权限运行)
1.MYSQL的降权运行 新建立一个用户比如mysql net user mysql microsoft /add net localgroup users mysql /del 不属于任何组 ...
- ios学习笔记 UITableView(纯代码) (一)
参考 “https://www.cnblogs.com/ai-developers/p/4557487.html” UITableViewCell 有一个代码重用 减少资源的浪费 参考 https: ...
- AJPFX谈Java 性能优化之基本类型 vs 引用类型
★名词定义 先明确一下什么是“基本类型”,什么是“引用类型”. 简单地说,所谓基本类型就是 Java 语言中如下的8种内置类型: booleancharbyteshortintlongfloatdou ...