Skip to content

Instantly share code, notes, and snippets.

@harrygg
harrygg / free_disk_space.sh
Created March 11, 2017 09:53
Runs every day and checks if disk space is less than 5 GB, then deletes some files until free space is bigger than 5 GB
#!/bin/sh
# set -x
# Shell script to monitor or watch the disk space
cd /home/camera/FI9831P_00626E654229/record
free=`df -k --output=avail "$PWD" | tail -n1`
treshold=5000000 #5GB Free space needed
@harrygg
harrygg / build_nginx.sh
Created February 9, 2016 15:20 — forked from MatthewVance/build_nginx.sh
Fetch, build, and install the latest nginx with the latest OpenSSL for RaspberryPi
#!/usr/bin/env bash
# make script exit if a simple command fails and
# make script print commands being executed
set -e -x
# names of latest versions of each package
export VERSION_PCRE=pcre-8.38
export VERSION_OPENSSL=openssl-1.0.2f
export VERSION_NGINX=nginx-1.9.10