| Crates.io | dateframe |
| lib.rs | dateframe |
| version | 0.2.4 |
| created_at | 2024-02-21 18:12:19.627494+00 |
| updated_at | 2024-03-07 05:19:17.025408+00 |
| description | Clean up files & folders |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1148338 |
| size | 29,063 |
Clean up folders & files!
Dateframe is meant to keep a running collection of folders. The reason I created it is I copy security camera footage from my security system to my NAS, but I don't want to keep copies for all time. This will allow me to scrub extraneous footage automatically.
dateframe.conf in the root of the folder you want to maintain (see documentation below).docker run -v /your/path/here:/var/data -d --name dateframe ghcr.io/jacksonzamorano/dateframe:latestdateframe.conf in the root of the folder you want to maintain (see documentation below).cargo install dateframe.dateframe path/to/your/directory.--gen-test: Generates a structure of test files.--once: Runs once, and does not start a daemon.Configuration is provided in the format key=value (without spaces). Note all times are parsed and formatted in your machine's local time.
formatFormat specifies how dates from file/foldernames should be parsed. The format is provided by the chrono crate, check out the documentation here. Multiple formats can be provided, and all will be tried on each file.
retentionRetention specifies how long folders & files should stay. Here are the following formats:
xxd (replacing xx with number of days)deepDefaults to true. Can be true or false. If true, folders are recursively searched instead of just cleaning the root directory.
refreshNumber specified in seconds. After cleaning, this number specifies how long dateframe should sleep before cleaning again. Default is 360 (1 hour).
logDefines how much information will go to the console. They are listed in most verbose to least:
debuginfoerrorsilentDefault is info.
removeSpecific words/items to be removed. Multiple copies of this key can be provided and all will be used.
split_stringFor more complicated filenames, you may want to split on a specific string or character. For example, consider this filename: "2024-02-21T04-23-57 smartDetectZone (person)". We could add "smartDetectZone" and "(person)" to the remove key but it would instead me easier to split on a string and use the first element.
So, set split_string to an empty space split_string= .
split_indexAfter a split_string is provided and executed, select which indicies to be used. Multiple copies of this key can be provided and all will be used.
split_joinAfter a split_string is performed and the proper selections are found, the selected strings are joined using this value. Default is "" (blank string).
date_only_behaviorIf only a date format is used (for example YYYY-mm-DD), a time needs to be added to determine if the date is past the retention policy. There are several options:
start: 00:00:00noon: 12:00:00end: 23:59:59h[x]: x:00:00The default is start.