2017年10月25笔记

Centos7安装 gcc编译器  http://blog.csdn.net/gw85047034/article/details/52957516

Centos7配置yum源  http://blog.csdn.net/lcj200813138020/article/details/46914161

http://www.ttlsa.com/web/let-infotify-rsync-fast/  inotify+rsync同步方案

inotify的使用  http://blog.csdn.net/god_wot/article/details/50448814

    • 可取之处为使用脚本
      [root@iZ25w1kdi5zZ scripts]# vi inotify_start.sh  
      /usr/local/inotify/bin/inotifywait -mrq -e modify,create,move,delete \                                 -m:monitor    r:recursive  q:quiet  e:events
      --fromfile '/opt/scripts/ffile' \ 意为监控ffile下面的目录  ffile中内容为 /root
      --timefmt '%y-%m-%d %H:%M' --format '%T %w %f %e' \  生成的inotify.log的格式     17-10-25 17:31 /root/test/dir/ dfile CREATE
      --outfile '/tmp/rsync.log'  生成log位置

      inotify打印说明:

      前提:对root目录下的文件和文件夹操作

      [root@localhost ~]# vi /tmp/rsync.log
      17-10-25 17:31 dfile CREATE
      17-10-25 17:31 /root/test/dir/ dfile CREATE   可以具体到目标文件位置  这样在通过rsync来同步指定的文件就使rsync效率高多了 

 让程序在后台运行:   

 [root@localhost ~]# sh /opt/scripts/inotify_start.sh
^Z                                                                                                             ----:让前台程序在停止
[1]+  Stopped                 sh /opt/scripts/inotify_start.sh
[root@localhost ~]# jobs -l                                                                 ----:查看当前jobs
[1]+ 27978 Stopped                 sh /opt/scripts/inotify_start.sh
[root@localhost ~]# bg 1                                                                   ---:指定job号为1的进程在后台运行,相当于 &
[1]+ sh /opt/scripts/inotify_start.sh &
[root@localhost ~]# jobs -l             
[1]+ 27978 Running                 sh /opt/scripts/inotify_start.sh &
[root@localhost ~]# fg  1                                                                   ---:调用后台进程在前台执行
sh /opt/scripts/inotify_start.sh














  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值