0 18 * * * PERCENT=$(df -h / | tail -n 1 | tr -s ' ' | cut -d ' ' -f5 | sed 's/\%//g'); if [[ $PERCENT -ge 97 ]]; then echo 'Running out of storage!'; fi
In the context of Benjamin_Loison/android_packages_apps_Recorder/issues/4 where potentially record everyday may exceed this threshold once and compress but the next day exceed again, hence should look for another solution but it may be clearer that running out of disk despite compressing if it notifies more quickly.
+2
<details>
<summary>Currently I use <code>crontab</code>:</summary>
```
0 18 * * * PERCENT=$(df -h / | tail -n 1 | tr -s ' ' | cut -d ' ' -f5 | sed 's/\%//g'); if [[ $PERCENT -ge 97 ]]; then echo 'Running out of storage!'; fi
```
</details>
In the context of [Benjamin_Loison/android_packages_apps_Recorder/issues/4](https://codeberg.org/Benjamin_Loison/android_packages_apps_Recorder/issues/4) where potentially record everyday may exceed this threshold once and compress but the next day exceed again, hence should look for another solution but it may be clearer that running out of disk despite compressing if it notifies more quickly.
+2
Benjamin_Loison
changed title from Run a command when fill a given percentage of the disk to Run instantaneously a command when fill a given percentage of the disk2025-01-25 01:08:54 +01:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Currently I use
crontab:In the context of Benjamin_Loison/android_packages_apps_Recorder/issues/4 where potentially record everyday may exceed this threshold once and compress but the next day exceed again, hence should look for another solution but it may be clearer that running out of disk despite compressing if it notifies more quickly.
+2
Run a command when fill a given percentage of the diskto Run instantaneously a command when fill a given percentage of the diskMaybe inotify may help.