一、安装

1)  从内核和目录里面查看是否支持inotify

[root@nfs01 ~]# uname -r

2.6.32-573.el6.x86_64

[root@nfs01 ~]# ls -l /proc/sys/fs/inotify/    -→主要查看下面有没有三个目录

总用量 0

-rw-r--r-- 1 root root 0 1月  21 13:03 max_queued_events

-rw-r--r-- 1 root root 0 1月  21 13:03 max_user_instances

-rw-r--r-- 1 root root 0 1月  21 13:03 max_user_watches

2)检查是否有安装inotify 如果没有就安装

rpm -qa inotify-tools

没有就先安装epol源

yum.repos.d]# wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo

之后安装

[root@nfs01 ~]# yum install inotify-tools -y

二、参数讲解、

[root@nfs01 ~]# which inotifywait

/usr/bin/inotifywait

[root@nfsserver inotify-tools]# bin/inotifywait —help

r :递归查询目录

q:打印很少的信息,仅仅打印监控事件的信息  安静状态

m:始终保持事件监听状态

excluder#排除文件或者目录的时候不区分大小写

timefmt:指定时间输出的格式

d :后台运行

-e: 事件 里面有很多方法

下面是事件参数

Events:

        access          file or directory contents were read   访问

        modify          file or directory contents were written  修改

        attrib          file or directory attributes changed  属性发生变化

        close_write     file or directory closed, after being opened in  写入之后关闭

                        writeable mode

        close_nowrite   file or directory closed, after being opened in  

                        read-only mode

        close           file or directory closed, regardless of read/write mode 

        open            file or directory opened

        moved_to        file or directory moved to watched directory  移动到哪里

        moved_from      file or directory moved from watched directory

        move            file or directory moved to or from watched directory

        create          file or directory created within watched directory

        delete          file or directory deleted within watched directory

        delete_self     file or directory was deleted

        unmount         file system containing file or directory unmounted卸载

之后就可以和nfs共享服务器之间的实时备份

inotify工具安装配置的更多相关文章

  1. Linux系统inotify工具安装配置

    inotify主要功能 Inotify 是一个 Linux特性,它监控文件系统操作,比如读取.写入和创建.Inotify 反应灵敏,用法非常简单,并且比 cron 任务的繁忙轮询高效得多.学习如何将 ...

  2. Oracle 客户端安装 + pl/sql工具安装配置

    Oracle 客户端安装 +  pl/sql工具安装配置 下载oracle客户端,并在本地安装. 11g下载地址为: http://www.oracle.com/technetwork/databas ...

  3. Java开发环境及工具安装配置

    Java开发环境及工具安装配置 Windows JDK 下载地址 https://www.oracle.com/java/technologies/javase-downloads.html 安装配置 ...

  4. 自动化运维工具-mussh工具安装配置及简单使用讲解

    1.先决条件: 安装pssh工具的主机针对远程主机需要配置免秘钥认证: ssh-keygen -t rsa ssh-copy-id [remotehost] 2.下载mussh工具安装介质: http ...

  5. 自动化运维工具-pdsh工具安装配置及简单使用讲解

    1.先决条件: 安装pssh工具的主机针对远程主机需要配置免秘钥认证: ssh-keygen -t rsa ssh-copy-id [remotehost] 2.下载pssh工具安装介质: https ...

  6. 自动化运维工具-pssh工具安装配置及简单使用讲解

    1.先决条件:安装pssh工具要求python版本大于2.4即可. 安装pssh工具的主机针对远程主机需要配置免秘钥认证: ssh-keygen -t rsa ssh-copy-id [remoteh ...

  7. 博客图片上传picgo工具安装配置github图传使用

    摘要 对于每一个写博客的人来说,图片是至关重要.这一路经历了多次图片的烦恼,之前选择了微博个人文章那里粘贴图片的方式上传,感觉也挺方便的.但是由于新浪的图片显示问题,如果header中不设置 标签就不 ...

  8. java初级开发一系列的工具安装配置

    最近压力很大,刚刚帮朋友安装了一整套环境,按照印象写下此篇记录(没有图解),一是用来释放压力,二来希望可以帮到各位. 一.首先,Eclipse的安装,下载eclipse压缩包,一般为200~300M, ...

  9. inotify+rsync安装配置

    环境 系统 IP地址 主服务器 CentOS7.4 192.168.1.1 备份服务器 CentOS7.4 192.168.1.2 一.备份服务器 安装rsync(备) wget https://rs ...

随机推荐

  1. import tkinter与from tkinter import *的区别

    from tkinter import * class DirList(object): def __init__(self,initdir=None): self.top= Tk() ##可以不加t ...

  2. angularjs中的单选框绑定数据注意事项

    这里说的是angularjs 1.x 在实现单选框时,我们完全可以用html自带的<input type="radio"/>,但是配合angularjs 中的双向绑定, ...

  3. Spring Boot中的自定义start pom

    start pom是springboot中提供的简化企业级开发绝大多数场景的一个工具,利用好strat pom就可以消除相关技术的配置得到自动配置好的Bean. 举个例子,在一般使用中,我们使用基本的 ...

  4. 添加融云sdk报错 link command -v

    在xcode 文件夹下用add group 就可以了,不需要在project 里面添加依赖库

  5. 眠眠interview Question

    1.  Wkwebkit在异步回调  如何像webview的回调 一样在主线程回调.可以使用runloop 解决么? dispatch get main queue http://www.jiansh ...

  6. bokeyuan_python文章爬去入mongodb读取--LOWBIPROGRAMMER

    # -*- coding: utf-8 -*- import requests,os from lxml import etree from pymongo import * class Boke(o ...

  7. idea 创建的maven+spring+mybatis项目整合 报错无法创建bean

    报错如下: Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with n ...

  8. Catch That Cow--POJ3278

    Description Farmer John has been informed of the location of a fugitive cow and wants to catch her i ...

  9. PostGIS 快速入门(转)

    原文:http://live.osgeo.org/zh/quickstart/postgis_quickstart.html PostGIS 是 PostgreSQL 关系数据库的空间操作扩展.它为 ...

  10. Java - Spring AOP 拦截器的基本实现

    一个程序猿在梦中解决的 Bug 没有人是不做梦的,在所有梦的排行中,白日梦最令人伤感.不知道身为程序猿的大家,有没有睡了一觉,然后在梦中把睡之前代码中怎么也搞不定的 Bug 给解决的经历?反正我是有过 ...