All pastes #100695 Raw Edit

Miscellany

public php v1 · immutable
#100695 ·published 2006-07-26 10:48 UTC
rendered paste body
<?php// Sets the variables, containing certain usefull things //$space_total = 78779688; // full size of disk //$safety_space = // mounts the drive for use //system('mount /dev/sd0a /backup');//command that outputs the space used, into an array //exec('du -c /backup', $space_used);//print_r($space_used);//getting the last line i the array //$array_count = count($space_used);//print($array_count);$array_count = $array_count -1;$space_used = $space_used[$array_count];$space_used = substr($space_used, 0, -5);//print($space_used);//calculating the space left$space_left = ($space_total - $space_used);print($space_left);$space_free = (($space_left / 1024)/1024);print($space_free);// unmounts the drive after use //system('umount /dev/sd0a');?>