{"id":22785901,"url":"https://github.com/simonwaldherr/fsagent","last_synced_at":"2025-09-04T03:40:45.311Z","repository":{"id":57538876,"uuid":"151312350","full_name":"SimonWaldherr/fsagent","owner":"SimonWaldherr","description":"watch a folder for new or modified files and do something (copy, move, delete, send via mail, ...)","archived":false,"fork":false,"pushed_at":"2023-04-18T07:53:59.000Z","size":48,"stargazers_count":15,"open_issues_count":3,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-15T20:11:14.162Z","etag":null,"topics":["devops","devops-tools","events","filesystem","go","golang","hacktoberfest-accepted","monitoring"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SimonWaldherr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","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}},"created_at":"2018-10-02T19:37:02.000Z","updated_at":"2024-06-21T00:07:52.000Z","dependencies_parsed_at":"2024-06-20T02:46:40.879Z","dependency_job_id":"4fe2532f-f326-4c10-8096-22faffe43de6","html_url":"https://github.com/SimonWaldherr/fsagent","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/SimonWaldherr/fsagent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonWaldherr%2Ffsagent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonWaldherr%2Ffsagent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonWaldherr%2Ffsagent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonWaldherr%2Ffsagent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SimonWaldherr","download_url":"https://codeload.github.com/SimonWaldherr/fsagent/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonWaldherr%2Ffsagent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273548638,"owners_count":25125254,"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-09-04T02:00:08.968Z","response_time":61,"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":["devops","devops-tools","events","filesystem","go","golang","hacktoberfest-accepted","monitoring"],"created_at":"2024-12-11T23:08:23.720Z","updated_at":"2025-09-04T03:40:45.300Z","avatar_url":"https://github.com/SimonWaldherr.png","language":"Go","readme":"# fsagent\n\nfsagent is a Golang Application to perform various standard actions triggered by various events. FSAgent is highly customizable. And there is a [blockly based editor](https://simonwaldherr.github.io/fsagent/), too.\n\n## Name\n\nThe name FSAgent was originally the shorthand for File System Agent.  \nWith the support of additional triggers and data sources outside of file system events in the monitored folders, a new meaning for the letters F and S must be found. \nCurrently, I prefer the definition Free Service Agent. \n\n## Why\n\n**WARNING:** *sad true reality*  \n\nWhen planning and developing new (open source) applications / systems, you usually use the latest technologies (containerization (e.g. Docker), message queues (e.g. RabbitMQ, ZeroMQ, ActiveMQ, ...), databases (e.g. PostgreSQL, MariaDB, Redis, MongoDB, ...), ...), but if you're working for a non-startup Company, you often have to deal with old legacy enterprise applications.  \nThese applications do not have modern interfaces, many are decades old. The most modern communication channels of these applications are mostly FTP uploads and emails.\nI really mean FTP, not those new and fancy SFTP Servers.  \nHowever, many of these applications do not even have the functionality to upload, but can only store files in directories and need other applications such as [Bat](https://en.wikipedia.org/wiki/The_Bat!), [Blat](http://www.blat.net) or [Outlook](https://en.wikipedia.org/wiki/Microsoft_Outlook) to upload. \nBat or Blat is not fundamentally bad, but if your whole business depends on software like Blat, you have a big problem.  \nIn my free time, I have written this program for replacing such \"interfaces\". It is not just a replacement for Bat or Outlook, it monitors directories and executes predefined actions for new files. \nThe configuration is kept as simple as possible (and will become even easier) to be done by anyone in IT departments, not just programmers.  \nThe first goal was the elimination of the biggest pain in the ass. \nGradually, however, it is also planned to extend fsagent for the service composition/orchestration of other protocols such as [HTTP(S)](https://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol), [AMQP](https://en.wikipedia.org/wiki/Advanced_Message_Queuing_Protocol), [WebSub (PubSubHubbub)](https://en.wikipedia.org/wiki/WebSub).  \n\n## Install\n\nfsagent can easily installed by the ```go get```-command:\n\n```go get simonwaldherr.de/go/fsagent```\n\n## Config\n\nfsagent can do many things, these can be defined and configured with json files.\n\nstart the fsagent daemon with ```go run fsagent.go config.json``` or compile a binary (```go build```) and run it with ```./fsagent config.json```.\n\nthe **config.json** file could look like:\n```json\n[\n  {\n    \"verbose\": true,\n    \"debounce\": true,\n    \"folder\": \"/mnt/prod/Server/Transfer/701/%Y/%m/%d/\",\n    \"trigger\": \"fsevent\",\n    \"match\": \"^[0-9]+\\\\.[Tt][Xx][Tt]$\",\n    \"action\": [\n      {\n        \"do\": \"sleep\",\n        \"config\": {\n          \"time\": 500\n        },\n        \"onSuccess\": [\n          {\n            \"do\": \"mail\",\n            \"config\": {\n              \"name\": \"mail\",\n              \"subject\": \"Lorem Ipsum\",\n              \"body\": \"dolor sit amet\",\n              \"from\": \"notification@company.tld\",\n              \"to\": [\"example@domain.tld\"],\n              \"cc\": [\"example2@domain.tld\"],\n              \"bcc\": [\"example3@domain.tld\"],\n              \"user\": \"notification\",\n              \"pass\": \"spring2018\",\n              \"server\": \"webmail.domain.tld\",\n              \"port\": 587\n            },\n            \"onSuccess\": [\n              {\n                \"do\": \"move\",\n                \"config\": {\n                  \"name\": \"success/$file_%Y%m%d%H%M%S\"\n                }\n              }\n            ],\n            \"onFailure\": [\n              {\n                \"do\": \"move\",\n                \"config\": {\n                  \"name\": \"error/$file_%Y%m%d%H%M%S\"\n                }\n              }\n            ]\n          }\n        ]\n      }\n    ]\n  }\n]\n```\n\n### Trigger\n\nCurrently there are two triggers available, the most important trigger is filesystem event trigger based on [fsnotify](github.com/fsnotify/fsnotify).\nIf this is not possible (e.g. if you work on mounted drives and the fs event comes from a different system) you can use a ticker as trigger.\n\nTrigger | Info\n--------|------\nfsevent | file system event based on [fsnotify](github.com/fsnotify/fsnotify)\nticker  | checks for new files at a customizable frequency \nhttp    | files can be uploaded via a web form\n\n### Actions\n\nThere are some ready-made actions, but you can easily create others yourself.\n\nAction     | Info\n-----------|------\nCopy       | creates a copy of a given file at the specified destination\nDelete     | removes a file\nMove       | moves a file to a new location\nDecompress | decompresses a file\nCompress   | compresses a file\nHttpPostR. | sends the content of a file in a HTTP Post Request Body\nSendMail   | sends the file as mail attachment\nSleep      | waits for a specified duration\n\n## Todo / Contribute\n\nInformations about the [license](https://github.com/SimonWaldherr/fsagent/blob/master/LICENSE), [how to contribute](https://github.com/SimonWaldherr/fsagent/blob/master/CONTRIBUTING.md) and a [list of improvements to do](https://github.com/SimonWaldherr/fsagent/blob/master/TODO.md) are in separate files.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonwaldherr%2Ffsagent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonwaldherr%2Ffsagent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonwaldherr%2Ffsagent/lists"}