Add more tools

This commit is contained in:
2024-08-15 23:18:29 +02:00
parent 1bb00c4e2e
commit e74c6a4593
2 changed files with 79 additions and 2 deletions

View File

@@ -163,3 +163,79 @@ Entry struct {
// ^ (optional) amount of time (in milliseconds) to wait before running action on program startup
}
```
## [git-vc](https://git.site.quack-lab.dev/dave/git-vc)
**Monitors a directory and commits any changes to git on a set interval**
Meant to run as a service
Configuration is done through environmental variables:
- *ROOT*
- Defaults to /tmp
- *SCAN_INTERVAL*
- Defaults to 1m
Runs
`git add .` > `git commit -m "Update"` every *SCAN_INTERVAL* on *ROOT*
It also sets its identity to *system system@localhost*
The purpose of this tool is to make sure you never lose any data in a possibly volatile directory
For example given a directory where it's possible for files to spontaneously combust
This tool will ensure they're never really lost thanks to git
## [directory-cleaner](https://git.site.quack-lab.dev/dave/directory-cleaner)
**Archives and deletes "old" files in a given directory**
Meant to run as a service - preferably in a docker container
Meant to clean up "temporary" directories where the host program does not do a good job of deleting old entries, for example the windows temp
Configuration is given through environmental variables:
- *ROOT*
- Defaults to /tmp
- The root directory to be watched
- *ROOT_ARCHIVE*
- Defaults to *ROOT*/archive
- Directory in which "old" entries are placed before deletion
- *IGNORED_DIRECTORIES*
- Directories to ignore when scanning
- *SCAN_INTERVAL*
- Defaults to 1m
- Interval between scans
- *ARCHIVE_THRESHOLD*
- Defaults to 1d
- Time threshold for a file to be considered "old" and put into archive (*ROOT_ARCHIVE*)
- *DELETE_THRESHOLD*
- Defaults to 12h
- Time threshold for a file to be deleted out of the archive
- This threshold should be applied in addition to *ARCHIVE_THRESHOLD*
- For example to specify a lifetime of 2 days for files you could do 1d 1d between archive and delete
- *USE_MODTIME*
- Defaults to false
- Use modtime instead of accesstime
The tool uses access time to determine age of files with the thinking that files that should be deleted are ones that are not used
It also supports using mod time instead
This is important because moving files from *ROOT* to *ROOT_ARCHIVE* after *ARCHIVE_THRESHOLD* **resets their atime and mtime**
...because they're accessed and modified
Therefore file time to live is actually *ARCHIVE_THRESHOLD* + *DELETE_THRESHOLD*
## [directory-deletor](https://git.site.quack-lab.dev/dave/directory-deletor)
**Deletes given directories in a directory on a set interval**
Very similar to *directory-cleaner* except that this tool straight out deletes given directories
It's meant to combat windows unrelenting spam of "3D Projects" in ~
Who even uses that folder? Why is it there? Why can't I delete it? Well, now you can
Part of the configuration is done through command line arguments:
```
-scan int
scan interval in seconds (default 60)
-wd string
working directory
```
And part through environmental variables:
- *FORBIDDEN*
- csv separated list of directories to delete
- Those whose existence is forbidden
- *PATH_PREFIX*
- A prefix prepended to work directory
- Why? I don't remember

1
sync
View File

@@ -4,3 +4,4 @@
"C:\Users\Administrator\Seafile\Projects-Go\GoProjects\synclib\main.exe",cln.exe,t
"C:\Users\Administrator\Seafile\Projects-Go\GoProjects\gitea-api\main.exe",repo.exe,t
"C:\Users\Administrator\Seafile\Projects-Go\GoProjects\autoruns\main.exe",autoruns.exe,t
"C:\Users\Administrator\Seafile\Projects-Go\GoProjects\git-vc\main.exe",git-vc.exe,t