Skip to content

Instantly share code, notes, and snippets.

@checko
Created January 8, 2015 02:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save checko/4263ecf68686c101731f to your computer and use it in GitHub Desktop.
Save checko/4263ecf68686c101731f to your computer and use it in GitHub Desktop.
check disk usage and clear cache
#!/bin/sh
mkdir /cbox
mount -t vfat /dev/block/mmcblk0p7 /cbox
uspct=$(df | grep cbox | awk '{ print $5 }' | cut -d'%' -f1)
echo $uspct
if [ $uspct -ge 90 ]; then
echo 'great!'
rm -r /cbox/Android
rm -r /cbox/DCIM
fi
echo 'nothing'
umount /cbox
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment