Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13

Thread: Need help finding a Hit counter for a webpage

  1. #11
    Join Date
    Jun 2007
    Posts
    34
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    It is so close but no cigar. This second rule wasn't adding the "/" (without quote) after adminfolder. So that was no-good. Added the "/" in rule and it was then acting just like your first rule. Changing the URL correctly, yet the page would not load. Gives that dang "The page isn't redirecting properly" message. Hmmm. Will try another if you can think of some more possibilities. Could it be the conversion to SSL encryption that is hanging up FF? Thanks for the help in any event. Much appreciated. I'd be lost without your help.

    And appreciate the info about the BBClone installation. I'm less worried now. Will still do the Cron backup thing, and report in this thread about setup. Am curious how your folder bbclone/var looks? What are file sizes. Should I set up tar the folder and then gzip everything, or is it just a matter of backup the access.php file in that folder. Which would be helpful if the overload errors start appearing? I mean, don't mind setting cron job to backup or rename the file, replace with blank file, every month or every year if that's all required to keep the filesize buggy-be-gone. Again, thanks for the info.

  2. #12
    Join Date
    Aug 2005
    Location
    Other Side of My Monitor
    Posts
    3,494
    Thanks
    5
    Thanked 105 Times in 104 Posts
    Blog Entries
    1

    Default

    In my var folder access.php is 227KB and last.php is 127KB all others are 0 You can back them up, I wouldn't worry about resetting them to 0 every month, or gzip, unless you just want to.

    In the event it goes buggy just delete them and upload your latest ones. That's what I did Nov. '05 and it worked fine.
    {CWoT - Riddle } {Freelance Copywriter} {Learn to Write}
    Follow Me on Twitter: @InkingHubris
    PHP Code:
    $result mysql_query("SELECT finger FROM hand WHERE id=3");
    echo 
    $result

  3. #13
    Join Date
    Jun 2007
    Posts
    34
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default

    Hey Blizzard, thanks for the help. Just created a php file (backup_bbclone_data_files.php) that is executed via cron everyday in middle of night. It even sends an informative email.

    cron command is (you'll have to adjust yours per your server)
    Code:
    /ramdisk/bin/php4 $HOME/backup/bbclone_data_backups/backup_bbclone_data_files.php
    You probably already have something like below php file, named "backup_bbclone_data_files.php". This might be handy for next person who stumbles upon this forum looking for counter. Will need to adjust the email and domain and folder locations to your server setup.

    Code:
    <?php 
    
    // ------------------------------
    // Script to backup the two data files for BBClone: 
    //   /bbclone/var/access.php & /bbclone/var/last.php
    // should be executed by cron and saved in folder:
    //   /../backup/bbclone_data_backups/
    // with a new name including the date to differentiate files.
    // ------------------------------
    
    // Values for my server account
    $emailaddress = "email@domain.com"; 
    
    // today date
    $todaydate = date("ymd");
    
    // original and destination (wihout the .gz) filenames
    $orig_filename1 = "/home/myfolder/public_html/bbclone/var/access.php";
    $dest_filename1 = "/home/myfolder/backup/bbclone_data_backups/access.php_" . $todaydate; // year-month-day format
    
    $orig_filename2 = "/home/myfolder/public_html/bbclone/var/last.php";
    $dest_filename2 = "/home/myfolder/backup/bbclone_data_backups/last.php_" . $todaydate; // year-month-day format
    
    
    // deletes the file if it already exists
    if ( file_exists($dest_filename1) ) unlink($dest_filename1); 
    if ( file_exists($dest_filename2) ) unlink($dest_filename2); 
    
    
    // Perform copy and then gzip
    system("cp " . $orig_filename1 ." ". $dest_filename1, $result1); // copy file adding the date in filename
    system("gzip " . $dest_filename1, $result2);  // will gzip file and add the .gz extension
    
    system("cp " . $orig_filename2 ." ". $dest_filename2, $result3); // copy file adding the date in filename
    system("gzip " . $dest_filename2, $result4); // will gzip file and add the .gz extension
    
    //system("cp access.php ~/backup/bbclone_data_backups/access.php_080213",$result1); 
    //system("gzip ~/backup/bbclone_data_backups/access.php_080213",$result2); 
    
    //system("cp last.php ~/backup/bbclone_data_backups/last.php_080213",$result3); 
    //system("gzip ~/backup/bbclone_data_backups/last.php_080213",$result4); 
    
    
    // Analyze destination files and send email confirmation
    $size1 = filesize($dest_filename1.".gz"); 
    switch ($size1) { 
      case ($size1>=1048576): $size1 = round($size1/1048576) . " MB"; break; 
      case ($size1>=1024): $size1 = round($size1/1024) . " KB"; break; 
      default: $size1 = $size1 . " bytes"; break; 
    } 
    
    $size2 = filesize($dest_filename2.".gz"); 
    switch ($size2) { 
      case ($size2>=1048576): $size2 = round($size2/1048576) . " MB"; break; 
      case ($size2>=1024): $size2 = round($size2/1024) . " KB"; break; 
      default: $size2 = $size2 . " bytes"; break; 
    } 
    
    $message = "The bbclone data file backup has been run.\n\n"; 
    $message .= "The return code for cp of access.php was: " . $result1 . "\n"; 
    $message .= "The return code for gzip of access.php_".$todaydate." was: " . $result2 . "\n"; 
    $message .= "The return code for cp of last.php was: " . $result3 . "\n"; 
    $message .= "The return code for gzip of last.php_".$todaydate." was: " . $result4 . "\n\n"; 
    $message .= "The file path of access.php_".$todaydate.".gz is: " . $dest_filename1 . "\n"; 
    $message .= "The file path of last.php_".$todaydate.".gz is: " . $dest_filename2 . "\n\n"; 
    $message .= "Size of access.php_".$todaydate.".gz file: " . $size1 . "\n"; 
    $message .= "Size of last.php_".$todaydate.".gz file: " . $size2 . "\n\n"; 
    $message .= "Server time of the backup: " . date(" F d h:ia") . "\n\n"; 
    
    mail($emailaddress, "bbclone data backup was complete" , $message, "From: Website <>");
    
    ?>
    I still need to figure out my .htaccess aside issue.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •