自己撸一个框架,需要监控代码变化

安装fswatch

brew install fswatch

shell重启PHP脚本reload.sh

#!/bin/sh
do
ps -ef | grep php | grep -v grep | awk '{print $2}' | xargs kill -9
php /Users/x/www/php/LightMoon/examples/index.php
done

监控文件变化目录

fswatch -0 /Users/x/www/php/LightMoon| xargs -0 -n 1 /Users/x/www/php/LightMoon/bin/reload.sh

mac 监控文件变化并重启php的更多相关文章

  1. JDK 之 NIO 2 WatchService、WatchKey(监控文件变化)

    JDK 之 NIO 2 WatchService.WatchKey(监控文件变化) JDK 规范目录(https://www.cnblogs.com/binarylei/p/10200503.html ...

  2. Python监控文件变化:watchdog

    Python监控文件变化有两种库:pyinotify和watchdog.pyinotify依赖于Linux平台的inotify,后者则对不同平台的的事件都进行了封装.也就是说,watchdog跨平台. ...

  3. Gulp-前端进阶A-3---如何不刷新监控文件变化?

    npm install --save-dev gulp-connect npm install --save-dev gulp-livereload npm其他,前面已有 var gulp = req ...

  4. linux 监控文件变化

    介绍 有时候我们常需要当文件变化的时候便触发某些脚本操作,比如说有文件更新了就同步文件到远程机器.在实现这个操作上,主要用到两个工具,一个是rsync,一个是inotifywait .inotifyw ...

  5. python3 监控代码变化 自动重启 提高开发效率

    #!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'Michael Liao' import os, sys, time, sub ...

  6. inotifywait命令如何监控文件变化?

    转载自:https://segmentfault.com/a/1190000038351925 文件监控可以配合rsync实现文件自动同步,例如监听某个目录,当文件变化时,使用rsync命令将变化的文 ...

  7. 使用apache common-io 监控文件变化--转

    package common.io; import org.apache.commons.io.filefilter.FileFilterUtils; import org.apache.common ...

  8. 利用nodejs监控文件变化并使用sftp上传到服务器

    很久没写博客了,因为最近在用react+express做一个自己的工具型网站(其实就是夺宝岛抢拍器) 然后因为经常要改动,而且又要放到服务器上进行测试.总是要webpack,然后手动把文件上传上去,不 ...

  9. 使用apache common-io 监控文件变化

    package common.io; import org.apache.commons.io.filefilter.FileFilterUtils; import org.apache.common ...

随机推荐

  1. 安装kibana

    下载kibana5.1.1或者5.1.2版本的deb包,然后用dpkg命令安装 安装后启动位置在 /usr/share/kibana/bin中,在该目录下运行 ./kibana 即可启动 启动前应该先 ...

  2. 51Nod 1095 Anigram单词

    熟练使用map即可,不然用vector会超时 #include <iostream> #include <cstring> #include <string> #i ...

  3. hdu1233 还是畅通工程 基础最小生成树

    //克鲁斯卡尔 #include<iostream> #include<algorithm> using namespace std; ; struct node { int ...

  4. 地址重用REUSEADDR

    一个socket连接断开后会进入TIME_WAIT,大概有几十秒,这个时候端口是无法使用的,如果不设定地址重用,就会报错,说端口占用. 创建一个socket实例后,在对这个实例进行地址绑定前,要设定地 ...

  5. Lucky Array Codeforces - 121E && Bear and Bad Powers of 42 Codeforces - 679E

    http://codeforces.com/contest/121/problem/E 话说这题貌似暴力可A啊... 正解是想出来了,结果重构代码,调了不知道多久才A 错误记录: 1.线段树搞混num ...

  6. javascript简单的表单验证

    <html> <head> <title>用户登录</title> <script language="javascript" ...

  7. Myisamchk使用

    Myisam损坏的情况: . 服务器突然断电导致数据文件损坏;强制关机,没有先关闭mysql 服务;mysqld 进程在写表时被杀掉.因为此时mysql可能正在刷新索引. . 磁盘损坏. . 服务器死 ...

  8. Android 常见的工具类

    /** * Wifi 管理类 * * @author Administrator * 使用方法 * WifiManagerUtils wifiManager = new WifiManagerUtil ...

  9. spark性能优化-JVM虚拟机垃圾回收调优

    1 2 3 4

  10. Oracle的数据伪列(ROWNUM)

    作者:Vashon 时间:20150414 数据库:Oracle11g 数据伪列(ROWNUM) *范例:查询前5条记录:select rownum,empno,job,hiredate,sal fr ...