{"id":17132170,"url":"https://github.com/bitsofinfo/io-overwatch","last_synced_at":"2026-02-12T10:02:17.946Z","repository":{"id":57275636,"uuid":"60808894","full_name":"bitsofinfo/io-overwatch","owner":"bitsofinfo","description":"io-event-reactor based daemon for monitoring changes within one or more directories; then reacting by making directories, copying, moving, extracting files or inserting audit records into a database","archived":false,"fork":false,"pushed_at":"2024-09-10T21:42:57.000Z","size":103,"stargazers_count":1,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-21T07:46:55.038Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bitsofinfo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2016-06-09T21:39:54.000Z","updated_at":"2024-09-10T21:43:01.000Z","dependencies_parsed_at":"2025-06-12T16:47:38.888Z","dependency_job_id":null,"html_url":"https://github.com/bitsofinfo/io-overwatch","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bitsofinfo/io-overwatch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitsofinfo%2Fio-overwatch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitsofinfo%2Fio-overwatch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitsofinfo%2Fio-overwatch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitsofinfo%2Fio-overwatch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bitsofinfo","download_url":"https://codeload.github.com/bitsofinfo/io-overwatch/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bitsofinfo%2Fio-overwatch/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270791805,"owners_count":24645842,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-16T02:00:11.002Z","response_time":91,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T19:26:14.478Z","updated_at":"2026-02-12T10:02:12.921Z","avatar_url":"https://github.com/bitsofinfo.png","language":"JavaScript","readme":"# io-overwatch\n\n[io-event-reactor](https://github.com/bitsofinfo/io-event-reactor) based daemon for monitoring changes within one or more directories;\nthen reacting by making directories, copying, moving, extracting files or inserting audit records into a database.\n\n[![NPM](https://nodei.co/npm/io-overwatch.png?downloads=true\u0026downloadRank=true\u0026stars=true)](https://nodei.co/npm/io-overwatch/)\n\n## Usage\n\n### Method 1\n\n```\n\u003e$ git clone https://github.com/bitsofinfo/io-overwatch.git\n\u003e$ cd io-overwatch/\n\u003e$ npm install .\n\u003e$ node overwatch.js\n```\n\n### Method 2\n```\n\u003e$ mkdir overwatch\n\u003e$ cd overwatch/\n\u003e$ npm install io-overwatch\n\u003e$ node node_modules/io-overwatch/overwatch.js\n```\n\n```\nUsage: overwatch.js \u003ccommand\u003e [options]\n\nCommands:\n  dir  Monitor a directory and react to changes\n\nOptions:\n  --logging.file                Full path to log file                 [required]\n  --logging.level               Logging level\n         [choices: \"error\", \"warn\", \"info\", \"verbose\", \"info\", \"debug\", \"silly\"]\n                                                              [default: \"debug\"]\n  --logging.maxsize             Max size before rotation, in bytes\n                                                                [default: 10485760]\n  --logging.maxfiles            Max rotated files to retain          [default: 20]\n  --monitor.dir                 Directory to monitor                  [required]\n  --monitor.stabilityThreshold   Milliseconds for file sizes to remain constant\n                                 before reacting.               [default: 30000]\n  --evaluator.events            Space separated list of relevant event types\n  [array] [required] [choices: \"add\", \"addDir\", \"change\", \"unlink\", \"unlinkDir\"]\n  --evaluator.regex             Regex to apply to ioEvent.fullPath to trigger\n                                reactors                              [required]\n  --evaluator.reactors          Ordered list of reactors\n\t[array] [required] [choices: \"mkdir\", \"copyFile\", \"moveFile\", \"copyAll\",\n                                          \"moveAll\", \"extractFile\", \"sqlInsert\"]\n  --reactor.mkdir.dir           Target dir create. Variables apply.\n                                                                 [default: null]\n  --reactor.copyAll.target      Target dir to copy all files in monitored dir\n                                TO. Variables apply.             [default: null]\n  --reactor.moveAll.target      Target dir to move all files in monitored dir\n                                TO. Variables apply.             [default: null]\n  --reactor.copyFile.target     Target dir to copy evaluated file TO. Variables\n                                apply.                           [default: null]\n  --reactor.moveFile.target     Target dir to move evaluated file TO. Variables\n                                apply.                           [default: null]\n  --reactor.extractFile.target  Target dir to extract evaluated file TO.\n                                Variables apply.                 [default: null]\n  --reactor.sqlInsert.table     Table name for sql insert        [default: null]\n  --reactor.sqlInsert.columns   Space separated list of target table columns.\n                                                         [array] [default: null]\n  --reactor.sqlInsert.values    Space separated list of column values. Variables\n                                apply.                   [array] [default: null]\n  --reactor.shell.uid           uid to run shell commands as\n                                                           [default: 2146091417]\n  --reactor.shell.gid           gid to run shell commands as\n                                                           [default: 1028219364]\n  --reactor.db.host             database host                         [required]\n  --reactor.db.port             database port                    [default: 3306]\n  --reactor.db.user             database user                         [required]\n  --reactor.db.pw               database pw                           [required]\n  --reactor.db.name             database name                         [required]\n  --reactor.db.ssl.ca           database ssl ca certificate      [default: null]\n  --reactor.db.ssl.cert         database ssl certificate         [default: null]\n  --reactor.db.ssl.key          database ssl private key         [default: null] \n  --reactor.db.ssl.minVersion   database ssl min version         [default: null]\n  --reactor.db.ssl.maxVersion   database ssl max version         [default: null]\n  --reactor.db.ssl.rejectUnauthorized \n                                database name              [default: null] \n\nFor certain options you can use the following variables:\n {{{ioEvent.context.timestamp}}}\n {{{ioEvent.eventType}}}\n {{{ioEvent.fullPath}}}\n {{{ioEvent.parentPath}}}\n {{{ioEvent.parentName}}}\n {{{ioEvent.filename}}}\n {{{ioEvent.uuid}}}\n {{{ioEvent.context.[copyAll | copyFile | moveAll | moveFile | extractFileTo].target}}}\n ```\n\n## Usage samples table: (mysql)\n\n```\nCREATE TABLE `io_event` (\n  `eventType` varchar(256) NOT NULL,\n  `fullPath` varchar(256) DEFAULT NULL,\n  `stats` varchar(512) DEFAULT NULL,\n  `timestamp` varchar(256) DEFAULT NULL,\n  `filename` varchar(256) DEFAULT NULL,\n  `uuid` varchar(256) DEFAULT NULL,\n  `parentPath` varchar(256) DEFAULT NULL,\n  `parentName` varchar(256) DEFAULT NULL,\n  `target` varchar(256) DEFAULT NULL,\n  `context` varchar(45) DEFAULT NULL\n) ENGINE=InnoDB DEFAULT CHARSET=utf8;\n\n```\n\n## Usage sample one:\n\nMonitor one dir, when any file matching \\*test1\\* is changed\nmake a new target directory, move all files in the same directory\nas triggering file to the target dir, and then insert a sql record\nof the event.\n\n```\nmkdir /tmp/bitsofinfo\npm2 start sample1.pm2.json\n```\n\nOR\n\n```\nmkdir /tmp/bitsofinfo\n\nnode overwatch.js dir  \\\n\t--logging.file=./overwatch.log \\\n\t--monitor.dir=/tmp/bitsofinfo \\\n\t--monitor.stabilityThreshold=1000 \\\n\t--evaluator.events=change \\\n\t--evaluator.regex=\".*test1.*\" \\\n\t--evaluator.reactors=mkdir moveAll sqlInsert \\\n\t--reactor.mkdir.target=/tmp/{{{ioEvent.context.timestamp}}}/bitsofinfo_target \\\n\t--reactor.moveAll.target=/tmp/{{{ioEvent.context.timestamp}}}/bitsofinfo_target \\\n\t--reactor.sqlInsert.table=io_event \\\n\t--reactor.sqlInsert.columns=context eventType fullPath filename parentPath timestamp uuid parentName target \\\n\t--reactor.sqlInsert.values=moveAllToContext \"{{{ioEvent.eventType}}}\" \"{{{ioEvent.fullPath}}}\" \"{{{ioEvent.filename}}}\" \"{{{ioEvent.parentPath}}}\" \"{{{ioEvent.context.timestamp}}}\" \"{{{ioEvent.uuid}}}\" \"{{{ioEvent.parentName}}}\" \"{{{ioEvent.context.moveAll.target}}}\" \\\n\t--reactor.db.host=localhost \\\n\t--reactor.db.user=root \\\n\t--reactor.db.pw=root \\\n\t--reactor.db.name=io_event_reactor\n```\n\n\n## Usage sample two:\n\nMonitor one dir, when any file matching zip/tgz/gz is changed\nmake a new target directory, extract the zip/tgz to the target dir, then move all files in the same directory\nas triggering file to the target dir, and then insert a sql record\nof the event.\n\n```\nmkdir /tmp/bitsofinfo\npm2 start sample2.pm2.json\n```\n\nOR\n\n\n```\nmkdir /tmp/bitsofinfo\n\nnode overwatch.js dir  \\\n\t--logging.file=./overwatch.log \\\n\t--monitor.dir=/tmp/bitsofinfo \\\n\t--monitor.stabilityThreshold=1000 \\\n\t--evaluator.events=add change \\\n\t--evaluator.regex=\"(.+\\.zip$|.+\\.gz$|.+\\.tgz$)\" \\\n\t--evaluator.reactors=mkdir extractFileTo moveAll sqlInsert \\\n\t--reactor.mkdir.target=/tmp/{{{ioEvent.context.timestamp}}}/{{{ioEvent.parentName}}}/bitsofinfo_target \\\n\t--reactor.extractFileTo.target=/tmp/{{{ioEvent.context.timestamp}}}/{{{ioEvent.parentName}}}/bitsofinfo_target \\\n\t--reactor.moveAll.target=/tmp/{{{ioEvent.context.timestamp}}}/{{{ioEvent.parentName}}}/bitsofinfo_target \\\n\t--reactor.sqlInsert.table=io_event \\\n\t--reactor.sqlInsert.columns=context eventType fullPath filename parentPath timestamp uuid parentName target \\\n\t--reactor.sqlInsert.values=extractFileToContext \"{{{ioEvent.eventType}}}\" \"{{{ioEvent.fullPath}}}\" \"{{{ioEvent.filename}}}\" \"{{{ioEvent.parentPath}}}\" \"{{{ioEvent.context.timestamp}}}\" \"{{{ioEvent.uuid}}}\" \"{{{ioEvent.parentName}}}\" \"{{{ioEvent.context.extractFileTo.target}}}\" \\\n\t--reactor.db.host=localhost \\\n\t--reactor.db.user=root \\\n\t--reactor.db.pw=root \\\n\t--reactor.db.name=io_event_reactor\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitsofinfo%2Fio-overwatch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbitsofinfo%2Fio-overwatch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbitsofinfo%2Fio-overwatch/lists"}