shell 同步脚本
来源:互联网 发布:ni数据采集卡如何使用 编辑:程序博客网 时间:2024/06/16 13:11
shell不是很熟,备份一下代码。
#! /bin/bashtransfer(){ rsync -avz -e "ssh -i /home/xxxx/.ssh/id_rsa" $1 $2}if [ $# -lt 1 ]then echo "Usage: $0 path" 1>&2 exit 1fipath=$1if [ -d $path ]then path="$path/"fifile="conf/nodes.lst"for node in `cat $file`do echo "Transfer to $node ..." transfer $path "$node:~/$path"done
===================================
脚本用法:
conf/nodes.lst ==> 需要同步的机器列表
需要传入一个需要被同步的文件,l例如
./sync.sh files/file1.txt
rsync命令可参考:
http://www.linuxany.com/archives/226.html
- shell 同步脚本
- 同步文件的shell脚本
- 实现一个文件夹同步的shell脚本
- shell脚本----------路由和数据库的同步
- 使用php调用shell脚本同步文件
- Linux shell 脚本互斥同步
- Shell脚本——时间同步
- 使用shell脚本同步ntp服务器
- 自动同步服务器vm文件的shell脚本
- 自动监控主从MySQL同步的SHELL脚本
- 使用inotify实现实时文件同步shell脚本
- Linux下MySQL主从同步监控shell脚本
- 【甘道夫】实现Hive数据同步更新的shell脚本
- 使用inotify实现实时文件同步的shell脚本
- shell脚本监控mysql主从同步状态并自动修复
- [shell]用shell脚本将本地文件夹与ftp上的文件夹同步
- shell脚本
- shell脚本
- java http 给 c++发送json数据中文乱码问题
- Mahout源码分析之DistributedLanczosSolver(2)--Job1
- node.js与java性能测试(http,与redis访问)
- 【An problem about date 219】
- 批处理脚本读取文件内容赋值给一个变量
- shell 同步脚本
- ubuntu下安装putty
- Linux中du命令使用介绍
- Flash Build 开发技巧
- 配置PL/SQL DEVELOPER远程访问oracle数据库
- hdu 4735 Little Wish~ lyrical step~ (2013成都网络赛H题)(重复覆盖)
- 在localhost测试的jsp页面显示正常的,放到服务器上去字体就变大了,同一款浏览器测试的.
- c语言中的字符串
- opengl 开发笔记-绘制图形(图元)