Skip to content

Instantly share code, notes, and snippets.

@chipitsine
Last active January 15, 2016 12:56
Show Gist options
  • Save chipitsine/7097c4afb5f9c22fa00b to your computer and use it in GitHub Desktop.
Save chipitsine/7097c4afb5f9c22fa00b to your computer and use it in GitHub Desktop.
finds lost sites
#!/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