Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2372106
  • 博文数量: 298
  • 博客积分: 7876
  • 博客等级: 准将
  • 技术积分: 5500
  • 用 户 组: 普通用户
  • 注册时间: 2011-02-23 13:39
文章存档

2013年(2)

2012年(142)

2011年(154)

分类: LINUX

2012-04-25 16:03:47

dnotifyLinux的文件夹监控

 

Ubuntu下面监控文件夹可以使用命令dnotify

安装:apt-get install dnotify

 

Usage: dnotify [OPTION]... DIRECTORY... [-e COMMAND...]

Execute a command every time the contents of a directory change.

 

Events:

  -A, --access             trigger when a file in the directory was accessed

  -M, --modify             trigger when a file in the directory was modified

  -C, --create             trigger when a file was created in the directory

  -D, --delete             trigger whan a file was unlinked from the directory

  -R, --rename             trigger when a file in the directory was renamed

  -B, --attrib             trigger when the directory had its attributes

                           changed (after chmod, chown)

  -a, --all                all of the above

 

General:

  -e, --execute=COMMAND..  command to execute when an event is triggered

                           (all remaining args are treated as command args)

  -f, --file=FILE          read directories to monitor from FILE, one per line

  -p, --processes=COUNT    max number of commands to run at a time

  -q, --queue=DEPTH        max depth of queue holding commands to be run

  -t, --times=COUNT        exit after running the command COUNT times

  -o, --once               same as `--times 1'

  -r, --recursive          monitor subdirectories too (recursively)

  -b, --background         run in background (detach)

  -s, --silent             don't print warnings about non-zero child exits

      --quiet              same as `--silent'

      --help               display this help and exit

      --version            output version information and exit

 

Unless events have been specified, the events are set to create and delete.

 

Specifying -1 for queue means unlimited depth. The default value for --queue

is -1, and 1 for --processes.

 

The default command (unless specified with -e) is to print the name of the

of the directory updated. The string `{}' in the command specification is

replaced by the name of the directory that was updated.

 

Report bugs to .

阅读(4315) | 评论(0) | 转发(1) |
0

上一篇:后台(crontab,at,&,nohup)

下一篇:SED相关积累

给主人留下些什么吧!~~