Last active
January 15, 2016 12:56
-
-
Save chipitsine/7097c4afb5f9c22fa00b to your computer and use it in GitHub Desktop.
finds lost sites
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/sh | |
if [ ! -d "$1" ]; then | |
echo "Usage $0 /path/to/sites" | |
exit 1; | |
fi | |
totalsize=0 | |
for site in `ls $1`; do | |
if [ -d $1/${site} ]; then | |
if [ ! -f /etc/nginx/sites-enabled/${site} ]; then | |
echo "site $site does not exist." | |
size=`du -sk $1/${site} | awk '{print $1}'` | |
totalsize=$((totalsize + size)) | |
fi | |
fi | |
done | |
echo "Total size $totalsize kb" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment