mirror of
https://github.com/kerberos-io/documentation.git
synced 2026-11-24 23:10:23 +00:00
Merge branch 'develop' into 2.0
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
* [Web](#web)
|
||||
* [Install webserver + PHP (optional)](#web-installation-webserver)
|
||||
* [Install source](#web-installation-source)
|
||||
* [Auto removal](#auto-removal)
|
||||
|
||||
|
||||
<a name="how-to-install"></a>
|
||||
@@ -127,3 +128,36 @@ Change write permission on the storage directory.
|
||||
Reboot
|
||||
|
||||
sudo reboot
|
||||
|
||||
<a name="auto-removal"></a>
|
||||
## Auto removal
|
||||
|
||||
By default images or videos **aren't removed automatically**. This means that Kerberos.io will keep writing to disk, even if there is no more space available on your SD card. When your **SD card is full** you'll be **experiencing strange errors**: a corrupt web interface, blank images or corrupt videos.
|
||||
|
||||
To resolve this your should install a simple **bash script** and initiate **a cronjob** which continuously poll your filesystem, and start removing media when your disk is getting full.
|
||||
|
||||
Create a bash script and copy following script.
|
||||
|
||||
nano /home/pi/autoremoval.sh
|
||||
|
||||
Copy following script (make sure the partition is correct, this is the default one for a Raspberry Pi).
|
||||
|
||||
partition=/dev/mmcblk0p1
|
||||
imagedir=/etc/opt/kerberosio/capture/
|
||||
if [[ $(df -h | grep $partition | head -1 | awk -F' ' '{ print $5/1 }' | tr ['%'] ["0"]) -gt 90 ]];
|
||||
then
|
||||
echo "Cleaning disk"
|
||||
find $imagedir -type f | sort | head -n 100 | xargs -r rm -rf;
|
||||
fi;
|
||||
|
||||
Make the script executable.
|
||||
|
||||
chmod +x /home/pi/autoremoval.sh
|
||||
|
||||
Initiate a cronjob, and select the **nano** editor.
|
||||
|
||||
crontab -e
|
||||
|
||||
Append following line, to execute the **autoremoval.sh** script every 5min.
|
||||
|
||||
*/5 * * * * /bin/bash /home/pi/autoremoval.sh
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
* [Web](#web)
|
||||
* [Install webserver + PHP (optional)](#web-installation-webserver)
|
||||
* [Install source](#web-installation-source)
|
||||
* [Auto removal](#auto-removal)
|
||||
|
||||
|
||||
<a name="machinery"></a>
|
||||
@@ -119,3 +120,36 @@ Change write permission on the storage directory.
|
||||
Reboot
|
||||
|
||||
sudo reboot
|
||||
|
||||
<a name="auto-removal"></a>
|
||||
## Auto removal
|
||||
|
||||
By default images or videos **aren't removed automatically**. This means that Kerberos.io will keep writing to disk, even if there is no more space available on your SD card. When your **SD card is full** you'll be **experiencing strange errors**: a corrupt web interface, blank images or corrupt videos.
|
||||
|
||||
To resolve this your should install a simple **bash script** and initiate **a cronjob** which continuously poll your filesystem, and start removing media when your disk is getting full.
|
||||
|
||||
Create a bash script and copy following script.
|
||||
|
||||
nano /home/pi/autoremoval.sh
|
||||
|
||||
Copy following script (make sure the partition is correct, this is the default one for a Raspberry Pi).
|
||||
|
||||
partition=/dev/mmcblk0p1
|
||||
imagedir=/etc/opt/kerberosio/capture/
|
||||
if [[ $(df -h | grep $partition | head -1 | awk -F' ' '{ print $5/1 }' | tr ['%'] ["0"]) -gt 90 ]];
|
||||
then
|
||||
echo "Cleaning disk"
|
||||
find $imagedir -type f | sort | head -n 100 | xargs -r rm -rf;
|
||||
fi;
|
||||
|
||||
Make the script executable.
|
||||
|
||||
chmod +x /home/pi/autoremoval.sh
|
||||
|
||||
Initiate a cronjob, and select the **nano** editor.
|
||||
|
||||
crontab -e
|
||||
|
||||
Append following line, to execute the **autoremoval.sh** script every 5min.
|
||||
|
||||
*/5 * * * * /bin/bash /home/pi/autoremoval.sh
|
||||
|
||||
Reference in New Issue
Block a user