Quote:
Originally Posted by pljvaldez
Put this in a file filename.sh
Code:
#!/bin/sh
while true
do
date
df -lh | grep "/dev/sdb1"
sleep 180
done
Then chmod +x filename.sh.
The sleep command is in seconds, so sleep 180 is 3 minutes.
|
jvaldez - thanks for your attempt - I think something more needs to be done however...
I got the filename, setting the environment...
while true... hmmm... but what are we comparing it to? While -WHAT- is true?
From what I can see...
it's going to do the following...
while true... (while the following is true...)
do (do the following...)
date - outputs date to stdout
df -lh | grep "/dev/sdb1" - outputs drive info to stdout
sleep 180 - pauses for 180 seconds (3 minutes)
done - end loop
Once the script reaches the done marker, there's nothing left to be "true" as we haven't compared the current data size x against the maximum (730G). Also, since the next itteration would be incremented by 3 minutes, it would no longer be true, but false. Also, we haven't appended anything to a log file...
We're missing 2 key components.
So in my seudo/quazi code here's the logic I am seeing...
Start loop
Append date to copystat.log
Append df -lh | grep "/dev/sdb1" to copystat.log
check df -lh | grep "/dev/sdb1" for current drive capacity
if current drive capacity is less than 730G loop after 3 minutes
else if current drive capacity is 730G or more, end loop
Hope this helps.
I'm not sure as to how to write a script to accomodate this logic.
Thanks agian,