View Single Post

  #2 (permalink)  
Old 02-08-2007, 04:20 PM
nixcraft's Avatar
nixcraft nixcraft is offline
Never say die
User
 
Join Date: Jan 2005
Location: BIOS
My distro: Ubuntu
Posts: 1,061
Rep Power: 10
nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute nixcraft has a reputation beyond repute
Default

Try following code.

Code:
#!/bin/bash
line=$(df -h | egrep -v '^Filesystem' | head -1)
output=$(echo $line | awk '{ print $5}' | cut -d'%' -f1 )
if [ $output -ge 80 ]; then
  echo "Running tar command..."
  # add tar command below
else
  # do nothing :)
  :
fi
You need to add tar command as per your need
__________________
Vivek | My personal blog
Linux Evangelist
Play hard stay cool
Reply With Quote