The FuzzyBlog! : PHP Free Space Monitor Code The FuzzyBlog!

Marketing 101. Consulting 101. PHP Consulting. Random geeky stuff. I Blog Therefore I Am.

Home FuzzyGroup About Us Our Services

PHP Free Space Monitor Code


script to get the amount of free space with df -h and email it

to me daily

include "../z/class.phpmailer.php";

  $freespace = mysystem("df -h");
  $fortune = mysystem ("/usr/games/fortune");

  $email = "";
  //setup the email object & params
  $mail = new phpmailer();
  $mail->From = "";
  $mail->FromName = "Free Space Mailer";
  $mail->Subject = "Free Space On FuzzyGroup Server";
  $mail->Body    = $freespace . "\n\n\n\n" . $fortune;

    echo "Error – Can't Email User Info<p>";
    echo "Mailer Error: " . $mail->ErrorInfo;
  else {
    print "<pre>$freespace <BR><BR>$fortune</PRE>";

function mysystem($command) {
 if (!($p=popen("($command)2>&1","r"))) {
  return 126;

 while (!feof($p)) {
   $out .= $line;
 return $out;



This Page was last update: 4/16/2003; 10:20:40 AM

Copyright 2003 The FuzzyStuff

Theme Design by Bryan Bell

Click here to visit the Radio UserLand website. Subscribe to "The FuzzyBlog!" in Radio UserLand. Click to see the XML version of this web page. Click here to send an email to the editor of this weblog.