Linux / UNIX Tech Support Forum
This is a discussion on Shell script for automatic conversion of files in tar files within the Shell scripting forums, part of the Development/Scripting category; Hello i am new to shell script i need a shell script that sense the space is almost filled upto ...
|
Register free or login to your existing account and remove all advertisements. |
|
|||||||
| Shell scripting You can discuss the shell scripting, request shell scripts and scripting techniques |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
| Sponsored Links | ||
|
|
|
||||
|
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
__________________
Vivek Gite Linux Evangelist |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| split files by specifying a string (bash shell) | vikas027 | Shell scripting | 4 | 11-01-2007 05:22 PM |
| Script to extract some part of files: | satish1482 | Shell scripting | 0 | 03-13-2007 06:30 PM |
| shell script to open log files and check for faults | trueman82 | Shell scripting | 1 | 11-23-2006 03:35 AM |
| shell script that parses multiple log files and checks for a | Anonymous | Shell scripting | 1 | 11-15-2006 10:38 PM |
| script for uploading files to a FTP server | marinm | Shell scripting | 7 | 01-02-2006 08:35 PM |