CRE Loaded Community

Banner


Board index » Loaded Commerce Support » Tips & Tricks

All times are UTC - 5 hours




Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: SiteTool: Monitor and log files for changes
PostPosted: Tue Aug 29, 2006 6:42 pm 
Offline
CRE Talented
User avatar

Joined: Mon Jan 09, 2006 1:00 am
Posts: 333
The script is located down a few posts


I have finished testing the script:

What it does:
1: Monitor files for changes from hackers

2: While updating your site, make a log of all file changes - deleted files, added files, file time changes, file permissions changes and file size changes

More Info:
This is not FAM, but a php script.
There is a limit of the number of files it can check (php 30 sec timeout). Using cron each nite I have it checking my - root files, templates files and includes files. It takes about 10 secs to run through 850+ files.


Last edited by pyramids on Mon Sep 25, 2006 12:51 pm, edited 2 times in total.

Top
 Profile  
 
 Post subject: Re: Is anyone interested in a script that will do the follow
PostPosted: Mon Sep 11, 2006 3:42 am 
Offline
CRE Talented
User avatar

Joined: Mon Jan 09, 2006 1:00 am
Posts: 333
Here is a great way to journal the changes you make to your site without lifting a finger.

Also this script will let you know when your ERROR.LOG changes to alert you to problems on the site.

sample of log file:
Code:
New Log started on Thursday 08/24/2006  10:49:25
*-------------------------------------*

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sitemonitor was run on Friday 08/25/2006  11:07:46
Checked 882 files.
No changes were found.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Log was last updated on Saturday 08/26/2006  11:07:55
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NEW FILE: test43a.html
NEW FILE: test18.html
NEW FILE: test18l.html
DELETED FILES: test3a.html
DELETED FILES: test43.html
TIME CHANGED: templates/content/product_info.tpl.php Was: Wednesday, 16 Aug 2006 18:35:26 Last Changed on Saturday, 26 Aug 2006 16:30:39
SIZE CHANGED: error_log  Now: 136189 Was: 135520
TIME CHANGED: error_log Was: Thursday, 17 Aug 2006 17:49:23 Last Changed on Saturday, 26 Aug 2006 16:21:11
PERMISSIONS CHANGED: test4123.html Currently: "744" was: "644"
Total Number of files now being checked on the server: 883 files
Script timer: 13.1525268555 seconds.
The Reference file was last updated on Saturday 08/26/2006  10:49:25


Top
 Profile  
 
 Post subject: Re: Is anyone interested in a script that will do the following:
PostPosted: Mon Sep 11, 2006 5:47 pm 
Offline
CRE Freak
User avatar

Joined: Fri Jan 13, 2006 1:00 am
Posts: 113
Sounds interesting. Please tell me more information and where I can get a copy to test out for myself. Thanks


Top
 Profile  
 
 Post subject: Re: Is anyone interested in a script that will do the follow
PostPosted: Mon Sep 11, 2006 6:06 pm 
Offline
CRE Talented
User avatar

Joined: Mon Jan 09, 2006 1:00 am
Posts: 333
Junz, great I would appreciate you giving me your opinion after testing it.

PM me your email address and I will sent it to you.


Top
 Profile  
 
 Post subject: Re: Is anyone interested in a script that will do the follow
PostPosted: Sun Sep 17, 2006 9:28 pm 
Offline
CRE Talented
User avatar

Joined: Mon Jan 09, 2006 1:00 am
Posts: 333
The script I have is a modified version of SiteMonitor:

http://www.oscommerce.com/community/contributions,4441


Top
 Profile  
 
 Post subject: Re: Is anyone interested in a script that will do the follow
PostPosted: Sun Sep 17, 2006 9:38 pm 
Offline
CRE Talented
User avatar

Joined: Mon Jan 09, 2006 1:00 am
Posts: 333
Here is what the daily email I receive looks like:

Site Monitor Results

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Log was last updated on Monday 09/11/2006 21:53:38
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sitemonitor was run on Tuesday 09/12/2006 01:00:01
Total Number of files now being checked on the server: 845 files
NO DELETED FILES ...
NO NEW FILES ...
NO SIZE MISMATCH ...
NO TIME MISMATCH ...
NO PERMISSIONS MISMATCH ...
Script timer: 9.06695914268 seconds.
The Reference file was last updated on Monday 09/11/2006 21:53:18
"www.MyDomain.com/site_monitor/sitemonitor_log.txt"


Top
 Profile  
 
 Post subject: Re: Is anyone interested in a script that will do the follow
PostPosted: Mon Sep 25, 2006 12:46 pm 
Offline
CRE Talented
User avatar

Joined: Mon Jan 09, 2006 1:00 am
Posts: 333
Here is the script
It was tested on Cre Loaded 6.15
This script will monitor any server files, it does not need to be Cre Loaded

Here is the readme file
Code:
Sitemonitor_log.php was created to journal all of the modifications I make to Cre Loaded 6.15.
This script automatically writes a log of all deleted files, added files, file time changes, file permissions changes and file size changes. This way if I need to review what files I have changed - then all I need to do is view my log or review my emails.

Once I am done using this script as a journal I then can use it to monitor my site for changes due to a hacker getting into my site. It will also tell me when my site's error log has changed thereby alerting me.

sitemonitor_log.php, v1.0 2006/08/22 by pyramids

Adapted from original $Id: sitemonitor.php,v 1.0 2006/08/02 by Jack_mcs

//////////////////
SETUP INSTRUCTIONS
//////////////////

fill in the settings in sitemonitor_log.php
create folder called site_monitor
password protect the site_monitor folder
place sitemonitor_log.php into the site_monitor folder
run the sitemonitor_log.php script for the first time manually "VERBOSE set to 1" the script will create the REF and LOG files then you are ready to setup cron (change the VERBOSE to 0 to run as a cron script)

cron setup (run in the am hours)
/usr/bin/php -q /home/YOUR_USER_NAME/public_html/site_monitor/sitemonitor_log.php

Note 1:
If you want to start a clean journal just delete the log file and run manually one time

Note 2:
On some servers - if you are having permission problems with site_monitor/sitemonitor_log.txt and site_monitor/sitemonitor_ref.txt, try the enclosed script FixLogPermissions.php which runs in the root.
Both of these newly created files need to have permission to write. Set to 755, if that does not work then set to 777.

Note 3:
There is a php time out of 30 seconds. This script can monitor about 1500 files before it timesout. I suggest that you monitor the root, includes and templates. If you want to monitor the admin then setup a second monitoring script. Just copy, rename and change the settings

Note 4:
This scrpt can be run manually without setting it up as a cron script




Here is the sitemonitor_log.php file
Code:
<?php
/*
  sitemonitor_log.php, v1.1 2006/08/22 by pyramids

  Adapted from original $Id: sitemonitor.php,v 1.0 2006/08/02 by Jack_mcs

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License

  Use at your own risk

  Modified the original sitemonitor.php to do the following:

1: Keep a detailed log (optional feature)
2: Update the reference file every time there are changes (optional feature)
3: Added a timer
4: Will now check all file changes including deleted files
5: List sub directories to exclude
6: Removed the call to "require('includes/application_top.php')"
7: Updated the mail function
8: Updated message and email reporting
9: Was 2 files - the script and it's functions, now just one file with both since we shortened the script to be more efficient
 
*/
// SETUP INSTRUCTIONS
// SET THE OPTIONS AND SETTINGS below
// create folder called site_monitor and make the permissions 777
// password protect the site_monitor folder
// place sitemonitor_log.php into the site_monitor folder
// run the sitemonitor_log.php script for the first time manually, the script will create the REF and LOG files
// then you are ready to setup cron (change the VERBOSE to 0 to run as a cron script)
//   cron setup
//   /usr/bin/php -q /home/YOUR_USER_NAME/public_html/site_monitor/sitemonitor_log.php
//
//Note: if you want to start a clean journal just delete the ref and log files and run the script once manually
//
/************** SET THE OPTIONS AND SETTINGS ****************/

define('VERBOSE', 1);       //set to 1 to see the results displayed on the page (for when running manually)

define('ALWAYS_EMAIL', 1);  //set to one to send an email even if no differences found - else only send if difference found

$subject = "Site Monitor Results";//edit email subject

$email = "YOUR_EMAIL_ADDRESS";//send email to this address

$email_reply_to = "YOUR_REPLY_TO_EMAIL_ADDRESS";//optional - can be blank - email header info

$email_from = "YOUR_FROM_EMAIL_ADDRESS";//optional - can be blank - email header info

$email_header_text = 'Site Monitor Results';//optional - can be blank - email header info

$start_dir = '/home/YOUR_USER_NAME/public_html';  //replace with your actual path - using the define from configure.php won't work on all setups

//where sitemonitor_log.php is located
$site_monitor_dir = '/home/YOUR_USER_NAME/public_html/site_monitor';

//don't check these directories - change to your liking - must be set prior to first run, if you decide to change them later, you will need to delete the ref file
$excludeList = array("admin","images","site_monitor"); 

// sub directories one level below the start dir that you want to exclude
$exclude_sub_dir_list = array("Pixame_v1","Helius","E-vector","espanol","german","paypal");

// link to the log file for the email message
$web_address = 'http://www.YOUR_WEB-ADDRESS.com/site_monitor/sitemonitor_log.txt';//name and http location of the log file, you can change the file name if you want

$journal = 1;// 1 means the ref file is overwrittten each time the script finds changes. 0 means the ref file is written only the first time the script is run

$keep_log = 1;//1 for keeping a log, 0 for no log

$timezone  = -5; //(GMT -5:00) EST (U.S. & Canada)

$adjtime = 3600;// server time adjustment

$site_log = '/sitemonitor_log.txt';

$site_ref = '/sitemonitor_ref.txt';

/********************* END EDIT OPTIONS ************************/

$sitemonitor_log = $site_monitor_dir . $site_log;

$referenceFile = $site_monitor_dir . $site_ref;

//  Start TIMER
//  -----------
$stimer = explode( ' ', microtime() );
$stimer = $stimer[1] + $stimer[0];
//  -----------

$headers = 'From: ' . $email_reply_to . "\r\n" . 'Reply-To: ' . $email_reply_to . "\r\n" . $email_header_text;
$ttlErrors = 0;
$error = 0;
$errorDELETED = 0;
$errorADDED = 0;
$errorSIZE = 0;
$errorTIME = 0;
$errorPERM = 0;
$msg = '';

// set def for part function
  define('NAME', 0);
  define('SIZE', 1);
  define('TIME', 2);
  define('PERM', 3);

  $level=1; // level is the first level started at
  $last=1; //this is set the same as level
  //set arrays
  $files = array();
  $hold_files = array();// hold a unchanged copy of the files
  $refFiles = array();
  $hold_refFiles = array();//hold an unchanged copy of the ref files
  clearstatcache();//start with a new stat cache

$appendfile = "a";
$writefile = "w";

$today = gmdate("l m/d/Y  H:i:s", time() + $adjtime*($timezone+date("I")));

/******************Check Log File *****************/
if ($keep_log == 1){
if (! file_exists($sitemonitor_log)){

$start_log = 'New Log started on ' . $today;
$start_log .= "\n*-------------------------------------*\n";

WriteLog($sitemonitor_log, $start_log, $writefile);

if (file_exists($sitemonitor_log))
{
$msg .= DisplayMessage('Created a New Log File.');
}
else{
$msg .= DisplayMessage('Failed to create a New Log File.');
}

}
else{
$adate = ($adjtime +filemtime($sitemonitor_log));
$date_file_updated = date ("l m/d/Y  H:i:s",$adate);

$msg .= DisplayMessage('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
$msg .= DisplayMessage("Log was last updated on " . $date_file_updated);
$msg .= DisplayMessage('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~');
$msg .= DisplayMessage("Sitemonitor was run on " . $today);

}
}
  /************** READ IN THE FILES ****************/
  CreateReferenceFile($start_dir, $level, $last, $files, $exclude_sub_dir_list);
  $hold_files = $files; //hold a fresh copy of server files

  /************** SAVE THE FILES OR, IF PRESENT, READ THEM IN ****************/

  if (! file_exists($referenceFile))
  {
    if (empty($files))
      $msg .= DisplayMessage('*** Reference file creation FAILED ***');
    else
    {
      WriteFile($referenceFile, $files, $writefile);

$msg .= DisplayMessage(' Made a new Reference file on ' . $today);

    }
    exit;
  }
  else
  {
    $refFiles = GetReferenceFiles($referenceFile);   //read in the saved file
   $hold_refFiles = $refFiles;// hold a unaltered copy of ref files
    $sizeA2 = count($refFiles);

  /************** COVERT REF FILES TO NORMAL FILENAME ****************/

    for ($i = 0; $i < $sizeA2; ++$i)
    {
      $refFiles[$i] = rtrim($refFiles[$i]);//remove ending white space
      $pos = strpos($refFiles[$i], ",");//read the number of places up to the first comma which is the file name
      $refFiles[$i] = substr($refFiles[$i], 0, $pos);//only put the file name in the array
    }
  }

  /************** COVERT NEW FILES TO NORMAL FILENAME ****************/
  $size = count($files);
  for ($i = 0; $i< $size; ++$i)
  {
    $files[$i] = str_replace("./", "", $files[$i]);
    $pos = strpos($files[$i], ",");
    $files[$i] = substr($files[$i], 0, $pos);
  }

  /************** SEE IF THERE ARE ANY NEW FILES ****************/
  $diff_added = array_diff($files, $refFiles);

  if (count($diff_added) > 0)
  {
     foreach($diff_added as $key => $value)  //can't use for loop due to keys staying constant - key 0 may not be present
     {
       $msg .= DisplayMessage('NEW FILE: ' . GetFileName($value));
       $errorADDED++;
       $ttlErrors++;
     }
  }

  /************** SEE IF THERE ARE ANY DELETED FILES ****************/
  $diff_deleted = array_diff($refFiles, $files);

  if (count($diff_deleted) > 0)
  {
     foreach($diff_deleted as $key => $value)  //can't use for loop due to keys staying constant - key 0 may not be present
     {
$msg .= DisplayMessage('DELETED FILES: ' . GetFileName($value));
        $errorDELETED++;
        $ttlErrors++;
     }
  }

  /************** SEE IF THE FILES HAVE CHANGED SIZE, TIME, OR PERMISSIONS ****************/

    $refFiles = $hold_refFiles;  //reload for all checks below
   $count_files = 0;

       for ($i = 0; $i < $size; ++$i)// CHECK FILES
       {
         if ($diff_added){if (in_array($files[$i], $diff_added)){continue;}}// ignor new added files
      
         for ($t = 0; $t < $sizeA2; ++$t)
         {

       if ($diff_deleted){if (in_array($refFiles[$t], $diff_deleted)){continue;}}//ignor deleted files

            if ($files[$i] === GetPart(NAME, $refFiles[$t]))
            {
            $count_files++;
               $newSize = GetSize($files[$i]);
               $oldSize = GetPart(SIZE, $refFiles[$t]);
               if ($newSize != $oldSize)
               {

$msg .= DisplayMessage('SIZE CHANGED: ' . GetFileName($files[$i]) . '  Now: '. $newSize . ' Was: ' . $oldSize);

                 $errorSIZE++;
                 $ttlErrors++;
               }

               $r = stat($files[$i]);
               if ($r[9] != GetPart(TIME, $refFiles[$t]))
               {
            $hold_time = ($adjtime + GetPart(TIME, $refFiles[$t]));
            $old_file_time = strftime ("%A, %d %b %Y %T", $hold_time);
            $hold_new_time = ($adjtime + $r[9]);
            $new_time = strftime ("%A, %d %b %Y %T", $hold_new_time);

$msg .= DisplayMessage('TIME CHANGED: '. GetFileName($files[$i]). ' Was: ' .  $old_file_time . ' Last Changed on ' . $new_time);

                 $errorTIME++;
                 $ttlErrors++;
               }

               $pCurrent = substr(sprintf('%o', @fileperms($files[$i])), -3);
               $pLast =  GetPart(PERM, $refFiles[$t]);
               if ($pCurrent != $pLast)
               {
$msg .= DisplayMessage('PERMISSIONS CHANGED: '. GetFileName($files[$i]). ' Currently: "' . $pCurrent . '" was: "' . $pLast .'"');

                 $errorPERM++;
                 $ttlErrors++;
               }

            }
         }
      // }
}
$msg .= DisplayMessage('Total Number of files now being checked on the server: ' . ($count_files + $errorADDED) . ' files');
//end routine for FILES HAVE CHANGED SIZE, TIME, OR PERMISSIONS

// if we have no errors in certain areas then print a message
if ($errorDELETED == 0){
  $msg .= DisplayMessage('NO DELETED FILES ...');
}

if ($errorADDED == 0){
  $msg .= DisplayMessage('NO NEW FILES ...');
}

if ($errorSIZE == 0){
  $msg .= DisplayMessage("NO SIZE MISMATCH ...");
}

if ($errorTIME == 0){
  $msg .= DisplayMessage("NO TIME MISMATCH ...");
}

if ($errorPERM == 0){
  $msg .= DisplayMessage("NO PERMISSIONS MISMATCH ...");
}
// end print messages

//  End TIMER
//  ---------
$etimer = explode( ' ', microtime() );
$etimer = $etimer[1] + $etimer[0];
$ourRunTime = $etimer-$stimer;
$msg .= DisplayMessage("Script timer: " . $ourRunTime . " seconds.");
//  ---------

   /*************** Write updated REF file and updated LOG file ******************************************/
$adate = ($adjtime +filemtime($referenceFile));
$date_file_updated = date ("l m/d/Y  H:i:s",$adate);

if ($ttlErrors){
//if setup as a journal then write a new ref file
if ($journal == 1){
       WriteFile($referenceFile, $hold_files, $writefile);//write a new base reference file if the old one changed
      $msg .= DisplayMessage('The Reference file was last updated on ' . $date_file_updated);
}
if ($keep_log == 1){
//found errors so write a log entry
       WriteLog($sitemonitor_log, $msg, $appendfile);//write log file

}

}
else{// if there aren't any changes then write to the log - no changes

$msgLOG = "\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nSitemonitor was run on " . $today . "\nChecked " . $count_files . " files.\nNo changes were found.\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n";

       WriteLog($sitemonitor_log, $msgLOG, $appendfile);//write log file

$msg .= DisplayMessage('The Reference file was last updated on ' . $date_file_updated);
}

/************** Mail Results *****************************************/
   if ($ttlErrors || ALWAYS_EMAIL)
   {

   $msg .= DisplayMessage($web_address_log);
       mail($email, $subject, $msg, $headers);// send email of details
     if (VERBOSE)
      echo 'Email sent to ' . $email;
   }

/****************** FUNCTIONS **********************/
function CreateReferenceFile($dir,$level,$last,&$files,$exclude_sub_dir)

  $dp=opendir($dir);

  while (false!=($file=readdir($dp)) && $level == $last)
  {
     if ($file!="." && $file!="..")
     {
        if (ExcludeDirectory($dir))
          continue;;
   
        if (is_dir($dir."/".$file))
        {
      
/* Skip these sub directories */
$holddir = 0;
for($i = 0; $i < count($exclude_sub_dir); $i++)
{
if ($file == $exclude_sub_dir[$i]){$holddir = 1;}
}
if ($holddir ==1){continue;}
/* End Skip these sub directories */
   
            CreateReferenceFile($dir."/".$file,$level+1,$last+1,$files,$exclude_sub_dir); // uses recursion
        }
        else
        {
            if (strpos($file, $site_ref) == FALSE)  //don't include the reference file
            {
               $locn = "$dir/$file";
               $r = stat($locn);
               $str = sprintf("%s,%d,%d,%d", $locn, $r[7], $r[9],substr(sprintf('%o', @fileperms($locn)), -3));
               $files[] = $str;  // reads the file into an array
            }
        }
     }
  }
closedir($dp);
}

function DisplayMessage($msg)
{
  $str = $msg;
  if (VERBOSE) echo $str . '<br>';
  return ($str . "\n");
}

function ExcludeDirectory($dir)
{
  global $excludeList;
  $path = GetFileName($dir);
  $parts = explode("/", $path);
  return (in_array($parts[0], $excludeList));
}

function GetFileName($full_path)
{
  global $start_dir;
  return substr($full_path, strlen($start_dir) + 1);
}

function GetSize($path)

  if(!is_dir($path))return filesize($path);
  $dir = opendir($path);
  while($file = readdir($dir))
  {
    if(is_file($path."/".$file))$size+=filesize($path."/".$file);
    if(is_dir($path."/".$file) && $file!="." && $file !="..")$size +=get_size($path."/".$file);     
  }
closedir($dir);
  return $size;
}

function GetPart($part, $path)
{
  $parts = explode(",", $path);
  return trim($parts[$part]);
}

function GetReferenceFiles($referenceFile)
{
   $refFiles = "";
   if (!( $refFiles = file($referenceFile)))
   {
     echo 'Failed to read Reference File';
     exit;
   }
   return $refFiles;
}

function WriteFile($filename, $files, $write_mode)
{
  $fpOut = fopen($filename, "$write_mode");

  if (!fpOut)
  {
     echo 'Failed to open file '.$filename;
     exit;
  }
 
  for ($idx = 0; $idx < count($files); ++$idx)
  {
    $str = $files[$idx]."\n";
    $str = str_replace('./','',$str);
   
    if (fwrite($fpOut, $str) == FALSE)
    {
       echo "Cannot write to file ($filename)";
       exit;
    }
  }
  fclose($fpOut);
}

function WriteLog($filename, $files, $write_mode)
{
  $fpOut = fopen($filename, "$write_mode");

  if (!fpOut)
  {
     echo 'Failed to open file '. $filename;
     exit;
  }
 
    if (fwrite($fpOut, $files) == FALSE)
    {
       echo "Cannot write to file ($filename)";
       exit;
    }
  fclose($fpOut);
}

clearstatcache();// empty the stat cache

?>



Here is the FixLogPermissions.php file
Code:
<?php
// run this script from the root using a http browser
chmod('site_monitor/sitemonitor_log.txt', 0777);
if (substr(sprintf('%o', fileperms('site_monitor/sitemonitor_log.txt')), -3) == 777){
echo 'Changed the permission on site_monitor/sitemonitor_log.txt to 777<br>';}
chmod('site_monitor/sitemonitor_ref.txt', 0777);
if (substr(sprintf('%o', fileperms('site_monitor/sitemonitor_ref.txt')), -3) == 777){
echo 'Changed the permission on site_monitor/sitemonitor_ref.txt to 777';}
?>


Added two changes 10-03


Last edited by pyramids on Tue Oct 03, 2006 6:48 pm, edited 2 times in total.

Top
 Profile  
 
 Post subject: Re: SiteTool: Monitor and log files for changes
PostPosted: Tue Sep 26, 2006 10:27 am 
Offline
CRE Talented
User avatar

Joined: Thu Oct 21, 2004 12:00 am
Posts: 281
This is pretty cool! Thanks for sharing!

However, whenever I run it, this message appears that doesn't make much sense to me (there are no changed files and everytime the same message appears):

Any clues?

Thanks!

Code:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Log was last updated on Tuesday 09/26/2006 07:56:32
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sitemonitor was run on Tuesday 09/26/2006 20:23:49
SIZE CHANGED: affiliate_faq.php Now: 910 Was: bak
TIME CHANGED: affiliate_faq.php Was: Wednesday, 31 Dec 1969 20:14:11 Last Changed on Saturday, 27 May 2006 19:49:08
PERMISSIONS CHANGED: affiliate_faq.php Currently: "644" was: "1146496142"
SIZE CHANGED: affiliate_faq.php Now: 910 Was: bak
TIME CHANGED: affiliate_faq.php Was: Wednesday, 31 Dec 1969 20:14:11 Last Changed on Saturday, 27 May 2006 19:49:08
PERMISSIONS CHANGED: affiliate_faq.php Currently: "644" was: "1146496142"
Total Number of files now being checked on the server: 1827 files
NO DELETED FILES ...
NO NEW FILES ...
Script timer: 26.784986972809 seconds.

_________________
www.KULTUhR.net


Top
 Profile  
 
 Post subject: Re: SiteTool: Monitor and log files for changes
PostPosted: Tue Sep 26, 2006 10:52 am 
Offline
CRE Talented
User avatar

Joined: Mon Jan 09, 2006 1:00 am
Posts: 333
Looks like you have it running with the setting:

$journal = 0;// 1 means the ref file is overwrittten each time the script finds changes. 0 means the ref file is written only the first time the script is run

Set the $journal = 1;

This will rewrite the ref file, otherwise it will keep referring to the same ref file.

This gives you 2 ways to run it. New ref file or never change the ref file each time you run the script.

I have mine set to $journal = 1;


Top
 Profile  
 
 Post subject: Re: SiteTool: Monitor and log files for changes
PostPosted: Tue Sep 26, 2006 12:32 pm 
Offline
CRE Talented
User avatar

Joined: Thu Oct 21, 2004 12:00 am
Posts: 281
I changed it to 1, but the error messages remain.
The weird thing is that the errors don't make sense:

affiliate_faq.php Now: 910 Was: bak
affiliate_faq.php Currently: "644" was: "1146496142"

and so on...

_________________
www.KULTUhR.net


Top
 Profile  
 
 Post subject: Re: SiteTool: Monitor and log files for changes
PostPosted: Tue Sep 26, 2006 1:05 pm 
Offline
CRE Talented
User avatar

Joined: Mon Jan 09, 2006 1:00 am
Posts: 333
try:
delete the ref file sitemonitor_ref.txt and run the script again to reset the starting reference


Top
 Profile  
 
 Post subject: Re: SiteTool: Monitor and log files for changes
PostPosted: Tue Sep 26, 2006 1:12 pm 
Offline
CRE Talented
User avatar

Joined: Mon Jan 09, 2006 1:00 am
Posts: 333
More info:

Check you ref file does it look like this?

/home/username/public_html/templates/content/account.tpl.php,9843,1152888662,644
/home/username/public_html/templates/content/account_edit.tpl.php,6454,1152888665,644
/home/username/public_html/templates/content/account_history.tpl.php,6017,1152888666,644
/home/username/public_html/templates/content/account_history_info.tpl.php,9623,1152888667,644
/home/username/public_html/templates/content/account_newsletters.tpl.php,4117,1152888669,644
/home/username/public_html/templates/content/account_notifications.tpl.php,7001,1152888672,644

if not please post a few lines


Top
 Profile  
 
 Post subject: Re: SiteTool: Monitor and log files for changes
PostPosted: Tue Sep 26, 2006 2:34 pm 
Offline
CRE Talented
User avatar

Joined: Thu Oct 21, 2004 12:00 am
Posts: 281
hi pyramid,
thanks taking the time trying to solve this.
yes, i already deleted the ref file with no success.
i looked into the file and it looks exactly as the content above.
i'm puzzled...

_________________
www.KULTUhR.net


Top
 Profile  
 
 Post subject: Re: SiteTool: Monitor and log files for changes
PostPosted: Tue Sep 26, 2006 2:42 pm 
Offline
CRE Talented
User avatar

Joined: Thu Oct 21, 2004 12:00 am
Posts: 281
hi again pyramid,

i figured it out... i had a file called "affiliate_faq.php,bak" in my root, which apparently caused the errors. I guess the sitemonitor didn't like the comma in the filename. i deleted it and now everything runs smooth as silk. Thanks again for posting this and your help!

Cécile

_________________
www.KULTUhR.net


Top
 Profile  
 
 Post subject: Re: SiteTool: Monitor and log files for changes
PostPosted: Sun Oct 15, 2006 4:51 pm 
Offline
CRE Freak
User avatar

Joined: Thu Jan 05, 2006 1:00 am
Posts: 97
Location: Pa
This works great on two of my sites but on this one I get this message...

Any suggestions where to look

jparts01 /home/jparts.com/www# /usr/local/bin/php -q /home/jparts.com/www/jparts.com/site_monitor/sitemonitor_log.php
Could not open input file: /home/jparts.com/www/jparts.com/site_monitor/sitemonitor_log.php

_________________
Ken


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next

Board index » Loaded Commerce Support » Tips & Tricks

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
It is currently Thu May 17, 2012 9:37 am
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

© CRE Loaded is a product of Chain Reaction Ecommerce, Inc. Usage & Privacy Policy