7 Commits

Author SHA1 Message Date
5f7ad327d9 hooks 2024-02-25 18:20:10 -08:00
fb42c14505 hooks 2024-02-25 18:18:00 -08:00
4090770b09 hooks 2024-02-25 18:16:43 -08:00
9d39f6c927 hooks 2024-02-25 18:06:19 -08:00
83df9d7981 disk-usage-warn: Fix invalid escape sequence for python 12 2024-02-25 17:59:01 -08:00
1b3d4cc204 noop to test hook 2020-01-02 10:44:30 -08:00
eaf87b1ad6 Trying to highlight bash code 2019-05-16 20:39:53 -07:00
2 changed files with 4 additions and 4 deletions

View File

@ -11,7 +11,7 @@ This is a simple script that will emit a warning to stderr when your disk usage
Example:
``` sudo pip3 install pyaml```
```sudo pip3 install pyaml```
* *logger* program, which should be on most distributions
@ -47,13 +47,13 @@ python3 /path/to/disk-usage-warn --config "/my/config/path-1" --config "/my/conf
As mentioned, the easiest way to use this script is with Crontabs. By default, cron jobs will send you an email any time a script outputs to stdout or stderr. Since this script will output lots of information onto stdout, and only output to stderr when a disk has become full, it's useful to redirect stdout to /dev/null, like so:
```
```bash
python3 /path/to/disk-usage-warn --config "/path-to-config" > /dev/null
```
So, in order to run this script every 5 minutes, use something like the following:
```
```bash
*/5 * * * * python3 /path/to/disk-usage-warn --config "/path-to-config" > /dev/null
```

View File

@ -87,7 +87,7 @@ class DiskUsageWarn:
for file_name in os.listdir(path):
one_config_path = os.path.join(path, file_name)
if re.match(".+\.yaml$", file_name):
if re.match(r".+\.yaml$", file_name):
self.log("Found yaml: " + file_name)
self.consume_config(one_config_path)
else: