- 浏览: 1499337 次
- 性别:
- 来自: 北京
-
文章分类
- 全部博客 (691)
- linux (207)
- shell (33)
- java (42)
- 其他 (22)
- javascript (33)
- cloud (16)
- python (33)
- c (48)
- sql (12)
- 工具 (6)
- 缓存 (16)
- ubuntu (7)
- perl (3)
- lua (2)
- 超级有用 (2)
- 服务器 (2)
- mac (22)
- nginx (34)
- php (2)
- 内核 (2)
- gdb (13)
- ICTCLAS (2)
- mac android (0)
- unix (1)
- android (1)
- vim (1)
- epoll (1)
- ios (21)
- mysql (3)
- systemtap (1)
- 算法 (2)
- 汇编 (2)
- arm (3)
- 我的数据结构 (8)
- websocket (12)
- hadoop (5)
- thrift (2)
- hbase (1)
- graphviz (1)
- redis (1)
- raspberry (2)
- qemu (31)
- opencv (4)
- socket (1)
- opengl (1)
- ibeacons (1)
- emacs (6)
- openstack (24)
- docker (1)
- webrtc (11)
- angularjs (2)
- neutron (23)
- jslinux (18)
- 网络 (13)
- tap (9)
- tensorflow (8)
- nlu (4)
- asm.js (5)
- sip (3)
- xl2tp (5)
- conda (1)
- emscripten (6)
- ffmpeg (10)
- srt (1)
- wasm (5)
- bert (3)
- kaldi (4)
- 知识图谱 (1)
最新评论
-
wahahachuang8:
我喜欢代码简洁易读,服务稳定的推送服务,前段时间研究了一下go ...
websocket的helloworld -
q114687576:
http://www.blue-zero.com/WebSoc ...
websocket的helloworld -
zhaoyanzimm:
感谢您的分享,给我提供了很大的帮助,在使用过程中发现了一个问题 ...
nginx的helloworld模块的helloworld -
haoningabc:
leebyte 写道太NB了,期待早日用上Killinux!么 ...
qemu+emacs+gdb调试内核 -
leebyte:
太NB了,期待早日用上Killinux!
qemu+emacs+gdb调试内核
http://blog.leezhong.com/project/2010/12/13/inotify-rsync.html
这个写得不对
rsync -av --progress --include=kk --exclude='*' --password-file=/etc/rsyncd.secrets /opt/backuptest/ haha@10.1.224.171::test
include必须写在exclude前面才起作用,要不就是exclude的*把所有的都覆盖了
inotify+rsync实时同步
-a 相当于 -rlptgoD 的集合
-u 等同于 --update,在目标文件比源文件新的情况下不更新
-v 显示同步的文件
--progress 显示文件同步时的百分比进度、传输速率
--delete 删除目标目录中多于源目录的文件
参考http://wandering.blog.51cto.com/467932/105113
注意:
1.启动用rsync --daemon
2.一定要注意结尾的/,意义不同
3.如果启动不了打开vim /etc/init.d/rsync
RSYNC_ENABLE=true
环境ubuntu11.04
vim /etc/rsyncd.conf
vim /etc/rsyncd.secrets
haha:haha
root@ubuntu:~# ls -l /etc/rsyncd.secrets
-rw------- 1 root root 10 2011-05-07 13:44 /etc/rsyncd.secrets
如果用 rsync -avu --progress --delete /opt/backtest/ haha@192.168.1.100::backup
就会删除掉多余的文件
-----------------------
rsync -av --password-file=/etc/rsyncd.secrets /opt/testhao/ test@192.168.106.101::backuptest
在/etc/rsyncd.secrets中只写test的密码即可
比如服务器端是test:test
客户端则是test
这个写得不对
rsync -av --progress --include=kk --exclude='*' --password-file=/etc/rsyncd.secrets /opt/backuptest/ haha@10.1.224.171::test
include必须写在exclude前面才起作用,要不就是exclude的*把所有的都覆盖了
inotify+rsync实时同步
-a 相当于 -rlptgoD 的集合
-u 等同于 --update,在目标文件比源文件新的情况下不更新
-v 显示同步的文件
--progress 显示文件同步时的百分比进度、传输速率
--delete 删除目标目录中多于源目录的文件
参考http://wandering.blog.51cto.com/467932/105113
注意:
1.启动用rsync --daemon
2.一定要注意结尾的/,意义不同
3.如果启动不了打开vim /etc/init.d/rsync
RSYNC_ENABLE=true
环境ubuntu11.04
vim /etc/rsyncd.conf
uid = root gid = root use chroot = no max connections = 5 pid file = /var/run/rsync.pid lock file = /var/run/rsync.lock log file = /var/log/rsync.log [backup] path = /opt/backup ignore errors read only = no list = yes auth users = haha secrets file = /etc/rsyncd.secrets
vim /etc/rsyncd.secrets
haha:haha
root@ubuntu:~# ls -l /etc/rsyncd.secrets
-rw------- 1 root root 10 2011-05-07 13:44 /etc/rsyncd.secrets
root@ubuntu:/opt# tree . ├── backtest │ ├── haoning │ ├── oo │ └── test └── backup ├── backup ├── oo └── test 2 directories, 6 files
root@ubuntu:/opt# rsync -av --progress /opt/backtest/ haha@192.168.1.100::backup Password: sending incremental file list ./ haoning 16 100% 0.00kB/s 0:00:00 (xfer#1, to-check=2/4) sent 128 bytes received 30 bytes 28.73 bytes/sec total size is 53 speedup is 0.34 root@ubuntu:/opt#
root@ubuntu:/opt# tree . ├── backtest │ ├── haoning │ ├── oo │ └── test └── backup ├── backup ├── haoning ├── oo └── test 2 directories, 7 files root@ubuntu:/opt#
如果用 rsync -avu --progress --delete /opt/backtest/ haha@192.168.1.100::backup
就会删除掉多余的文件
-----------------------
rsync -av --password-file=/etc/rsyncd.secrets /opt/testhao/ test@192.168.106.101::backuptest
在/etc/rsyncd.secrets中只写test的密码即可
比如服务器端是test:test
客户端则是test
发表评论
-
xl2tp 备份
2019-09-24 16:25 7922019年9月24日更新: 注意,需要开启firewall ... -
sdl笔记
2019-01-31 17:19 768sdl教程教程 https://github.com/Twin ... -
tinyemu
2019-01-24 17:59 1484参考https://bellard.org/jslinux/t ... -
aws搭建xl2tp给iphone使用
2018-12-26 21:37 19392019年12月26日 可以参考原来的配置 https:// ... -
consul的基本使用
2017-06-27 11:13 1448### 安装 [centos7上consul的安装](ht ... -
lvs的helloworld
2017-06-13 20:36 630###################lvs######### ... -
系统调用的helloworld
2017-05-04 16:14 690《2.6内核标准教程》 p293 #include < ... -
bitcoin和cgminer的安装
2017-04-05 22:45 1989参考 http://blog.csdn.net/rion_ch ... -
ceph安装和常用命令
2017-03-21 21:55 985/etc/hosts ssh-keygen ssh-copy- ... -
mobile terminal 笔记
2016-12-02 15:35 692找出旧的iphone4 越狱之后可以变个小操作系统 mobi ... -
socket基础和select(python)
2016-06-14 17:21 1845上接 c语言的socket基础ht ... -
socket基础(c语言)
2016-06-14 16:45 1041不使用select 普通的基础socket连接,对多个客户端的 ... -
ffmpeg+nginx 的直播(2,直播摄像头和麦克风)
2016-05-28 20:21 4419假设我的服务器是centos7 192.168.139.117 ... -
ffmpeg+nginx 的直播(1,直播播放的视频文件)
2016-05-26 17:11 665964位操作系统centos7 ############ 1.一 ... -
socat和netcat(nc)
2016-04-29 22:36 1788转 原文链接: http://www.wenquan.name ... -
neutron基础九(qemu nat网络)
2016-02-06 17:21 1676接上基础八,kvm透传nested忽略 1.在主机ce ... -
neutron基础八(qemu 桥接网络)
2016-02-06 13:13 1572qemu的桥接和nat的qemu启动命令是一样的,但是后续的脚 ... -
neutron基础七(qemu tap)
2016-02-02 17:02 1061使用qemu 建立个虚拟机 然后用tap设备, 根据基础六,t ... -
neutron基础六(bridge fdb)
2016-01-28 18:30 2322转发表 在三台机器上建立三个namespace 192.16 ... -
南北流量
2016-01-23 23:26 1867一、三层网络架构: 接入层:负责服务器的接入和隔离 汇聚层:汇 ...
相关推荐
echo 'Hello world' > input/test.txt ``` 接着运行WordCount示例: ```bash bin/hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-*.jar wordcount input output ``` 检查输出结果: ```bash bin/...
要在运行实用程序时专门锁定/tmp/my.lock ,请echo "hello, world!" : flock /tmp/my.lock echo "hello, world!" 您也可以使用一次运行rsync的单个实例-注意:无需转义双引号 flock -n /tmp/my-lock.lock rsync ...
Linux操作系统以其开源、高效、稳定等特性深受开发者的喜爱。...命令:`echo "HelloWorld" | sed 's/world/Python/'` 这些命令覆盖了Linux常见的一些基本操作和高级功能,希望对使用Linux的用户有所助益。
例如`echo "Hello World"`会输出字符串“Hello World”。 2. **tr**: 替换或删除字符。例如`echo "test" | tr "s" "S"`会将“test”中的`s`替换为`S`。 3. **sort**: 对文本行进行排序。例如`sort file.txt`会按照...
res.send('Hello World!'); }); app.listen(port, () => { console.log(`Server running at http://localhost:${port}`); }); ``` 6. **安全与优化**:确保安装必要的安全软件,如防火墙(UFW)和安全更新。...
- `echo "Hello, World!" > /tmp/hello.txt` - `chmod 755 文件名` - 使用vi编辑器,末行模式输入`:G`,首行输入`1G`,行首`0`,行末`$`。在当前行下插入输入`i`后按回车,复制5行`yy5`,删除10行`dd10`,查找`...
/bin/bash echo "Hello, World!"` #### 六、包管理器Yum - **概念**: Yum (Yellowdog Updater Modified) 是一种基于RPM包管理器的软件包管理系统。 - **常用命令**: - `yum install package`: 安装软件包。 - `...
- **示例**:`rsync -avz /local/path user@remote.host:/remote/path` #### 45. **crontab - 定时执行命令** - **用途**:设置定时任务。 - **示例**:`crontab -e` #### 46. **at - 安排一次性任务** - **...
例如,`let g:my_variable = "Hello, World!"`声明了一个全局变量。 3. **Vundle or NeoBundle**:这两个是Vim的插件管理工具,允许用户方便地安装、更新和管理Vim插件。在`.vimrc`中,用户会添加如`Plugin '...