{"id":22957544,"url":"https://github.com/tca166/reimagined-adventure","last_synced_at":"2026-05-17T01:39:58.809Z","repository":{"id":183824442,"uuid":"670807514","full_name":"TCA166/reimagined-adventure","owner":"TCA166","description":"C Linux daemon for controlling file types in directory","archived":false,"fork":false,"pushed_at":"2023-09-04T15:36:07.000Z","size":59,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-02T01:45:17.925Z","etag":null,"topics":["c","daemon","linux","unix","utility"],"latest_commit_sha":null,"homepage":"","language":"C","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/TCA166.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}},"created_at":"2023-07-25T22:15:09.000Z","updated_at":"2023-11-29T20:26:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"af38d2d3-9de3-4d72-9790-d76c60ce3b7b","html_url":"https://github.com/TCA166/reimagined-adventure","commit_stats":null,"previous_names":["tca166/reimagined-adventure"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/TCA166/reimagined-adventure","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TCA166%2Freimagined-adventure","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TCA166%2Freimagined-adventure/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TCA166%2Freimagined-adventure/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TCA166%2Freimagined-adventure/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TCA166","download_url":"https://codeload.github.com/TCA166/reimagined-adventure/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TCA166%2Freimagined-adventure/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266521495,"owners_count":23942448,"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-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"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":["c","daemon","linux","unix","utility"],"created_at":"2024-12-14T17:17:45.032Z","updated_at":"2026-05-17T01:39:53.777Z","avatar_url":"https://github.com/TCA166.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# reimagined-adventure\n\nC UNIX programs for controlling file types in directory\n\n## Program\n\nThe program version will delete every file that isn't whitelisted in the config file once and then shut off.\n\n```Bash\n./process \u003cpath to config\u003e ...\n```\n\nProcess supports 3 additional optional arguments:\n\n- -r: the recursive flag will make the process apply the rules of a given directory to it's subdirectories\n- -v: the verbose flag will make the process notify the user of it's actions\n- -c: the confirm flag will make the process check with the user on the deletions (Very useful for debugging config files)\n\nIdeally you use this utility to setup the daemon yourself using built in UNIX tools for that like cron.\n\n## Daemon\n\nThe daemon program will create a new daemon process called \"directory monitor\" that will monitor directories in config using the inotify API.\nShould a new file be added to a monitored directory, the directory-monitor will scan the directory where a change was detected and act accordingly.\n\n```Bash\n./daemon \u003cpath to config file\u003e ...\n```\n\nDaemon supports three additional arguments:\n\n- -r:recursive override that will force the daemon to act recursively globally\n- -v:verbose override\n- -l $level:will redirect the syslog output of daemon to syslog local facility with the given number (LOG_LOCAL0 etc).\n    Can be used to redirect the log to file when combined with a custom [syslog.conf](https://linux.die.net/man/5/syslog.conf).\n    By default the daemon uses the LOG_DAEMON facility.\n\nThe daemon uses the syslog to notify the user of it's status.\nAfter each received set of event from inotify the daemon will reload it's config, so feel free to modify the config freely.\nApart from the config reloading itself, a SIGUSR1 signal to the daemon will force an immediate reload.\nBy default the daemon logs when it activates, shutdowns gracefully (detects the config is missing), is terminated or crashes due to an error.\nWith the verbose flag the individual actions are also logged.\nThe daemon also creates a pid file at /var/run/directory-monitor.pid\n\n## Config file\n\nThere are three kinds of lines in the config file:\n\n- directory definition lines: these provide the path to the directory\n- whitelist lines: these define which files the program should ignore\n- variable lines: these set a value for the current scope\n\nEach whitelist line starts with either a \\t character (tab) or a number of spaces.\nAll whitelist lines that follow a dir def line are considered to apply to only this one directory.\nWhitelist lines should either contain filenames that should be ignored, or MIME types that should be ignored.\nYou can find what MIME type a file has by using this command:\n\n```Bash\nfile --mime-type \u003cfilename\u003e\n```\n\nVariable lines set the variable for the current scope.\nThe scope is determined with indentation just like whitelist lines.\nSo far only 3 variables are supported.\n\n1. recursive\n2. verbose\n3. move: if provided, the files in this directory won't be deleted, instead moved to the provided path.\n\nFollowing the variable name a : followed by a value must be provided.\nThe config format also supports comments, that are indicated by a single '#' character. Everything after that character is ignored.\nHere's an example config file:\n\n```config\n$move:./moved\n./onlyText\n    $move:./nonText\n    $recursive:true\n    $verbose:true\n    text/plain\n./onlyMusic\n    audio/mpeg #all of these audio files will remain\n    sound.ogg #and this one specific ogg file will remain\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftca166%2Freimagined-adventure","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftca166%2Freimagined-adventure","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftca166%2Freimagined-adventure/lists"}