Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
chomupashchuk authored Jan 31, 2021
1 parent 8a0ca19 commit 1cb4a0c
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Delete file service for Home Assistant. For example delete snapshots.

## WARNINGS
- **All files and file extensions are case sensitive (e.g. `JPG` in not same as `jpg` or `jpeg`).**
- **All files are case sensitive.**
- **Custom component is run from Home Assistant and has access from same python runtime environment. It means no access outside of Home Assistant visibility (for example Hassio paths or folders).**
- **Home Assistant runs custom components not as `root` and thus permissions towards files and folders must be checked manually as component cannot change to the user with higher privilidges.**
- **Integration should delete data only within specified parameters so removal of unwanted files is users responsibility (correct specification of names).**
Expand Down Expand Up @@ -39,8 +39,8 @@ data:
#### attributes:
- `folder` is used to indicate folder path. it is a mandatory attribute.
- `time` is used to indicate how old files must be in seconds in order to be deleted. Default is 24 hours (86400 seconds). It is an optional attribute.
- `only_extensions` is list of extensions of files that are allowed to be deleted. Cannot be used together with `except_extensions`. It is an optional attribute.
- `except_extensions` is list of extensions of files that are not allowed to be deleted. Cannot be used together with `only_extensions`. Note: extension names must match exactly, they are case sensitive. It is an optional attribute.
- `only_extensions` is list of extensions of files that are allowed to be deleted. Cannot be used together with `except_extensions`. Note: extension names must match exactly. It is an optional attribute.
- `except_extensions` is list of extensions of files that are not allowed to be deleted. Cannot be used together with `only_extensions`. Note: extension names must match exactly. It is an optional attribute.
- `except_files` is list of files that are not allowed to be deleted. Note: file names and extensions must match exactly, they are case sensitive. It is an optional attribute.
- `scan_subfolders` Indicates if subfolders to be scanned (default is `false`). It is an optional attribute.
- `remove_subfolders` Indicates if empty subfolders to be deleted (default is `false`). It is an optional attribute.
Expand All @@ -55,7 +55,7 @@ data:
```

#### Example 2
Delete files older than 24 hours with only extensions `png` and `jpg` (note that they are case sensitive and must match exactly) in folder `/config/image_snapshot/`:
Delete files older than 24 hours with only extensions `png` and `jpg` (note that they must match exactly) in folder `/config/image_snapshot/`:
```
service: delete.files_in_folder
data:
Expand All @@ -66,7 +66,7 @@ data:
```

#### Example 3
Delete files older than 1 hour except extensions `zip` and `yaml` (note that they are case sensitive and must match exactly) in folder `/config/image_snapshot/`:
Delete files older than 1 hour except extensions `zip` and `yaml` (note that they must match exactly) in folder `/config/image_snapshot/`:
```
service: delete.files_in_folder
data:
Expand All @@ -78,7 +78,7 @@ data:
```

#### Example 4
Delete files (even if creates less than a second ago) including files in subfolders (empty subfolders shall also be removed) except `important.txt` and `important.db` files when scanning folder `/config/test`:
Delete files (even if creates less than a second ago) including files in subfolders (empty subfolders shall also be removed) except `important.txt` and `important.db` files (nothe that names must match exactly and it is case sensitive) when scanning folder `/config/test`:
```
service: delete.files_in_folder
data:
Expand Down

0 comments on commit 1cb4a0c

Please sign in to comment.