This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Run this script as ROOT | |
# Display docker logs disk usage in human-readable | |
du -chs /var/lib/docker/containers/*/*json.log; | |
# Clean all docker logs | |
truncate -s 0 /var/lib/docker/containers/*/*-json.log; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# https://stackoverflow.com/a/47609921/1497139 | |
# Usage corstest -v http://example.com | |
#ansi colors | |
#http://www.csc.uvic.ca/~sae/seng265/fall04/tips/s265s047-tips/bash-using-colors.html | |
blue='\033[0;34m' | |
red='\033[0;31m' | |
green='\033[0;32m' # '\e[1;32m' is too bright for white bg. | |
endColor='\033[0m' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DATE="$(date '+%d.%m.%Y')" | |
ALLPROJECTSDIR='/var/www/html' || $3; # Type you projects folder. It could be /home/user/public_html | |
PROJECT=$1 # Project's Name is needed as script argument! | |
PROJECTDIR="$ALLPROJECTSDIR/$PROJECT" | |
BACKUPDIR="$HOME/backup" || $2 | |
PROJECTBACKUPDIR="$BACKUPDIR/$PROJECT" | |
CAPACITYLIMIT=95 # Setup your capacity limit | |
CURRENTCAPACITY=$(df -h $BACKUPDIR | tail -1 | awk '{print $5}' | cut -d '%' -f 1) | |
LOGFILE="$HOME/log/backup-files-$PROJECT.log" |