Jump to content
spooks

Contribution: Auto Backup Database

Recommended Posts

No backup on lgin

 

 

how r u logging in to admin, with htaccess by any chance?


Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Share this post


Link to post
Share on other sites

Hi Sam,

 

I'm getting a backup on each login and every 20 minutes while logged in.

I'm not getting a cron auto archive backup each night/every 24 hours as set.

I do have cron set in cpanel. My admin settings below:

 

Auto Backup Interval 20

Backup Save Interval 24

Backup Zip gzip

 

My backup.log:

 

Status: 404 Not Found

X-Powered-By: PHP/5.2.9

Content-type: text/html

No input file specified.

 

So do I need to ask host if cron command is differant? My cron below:

php $HOME/adminfoldername/includes/auto_backup_db.php > $HOME/public_html/adminfoldername/backups/backup.log

 

backups presently saved:

Download backup.log 10/23/2009 04:00:01 100 bytes

Download db_myusername_domainname-20091019220042.sql 10/19/2009 22:00:43 4,355,749 bytes Info

Download db_myusername_domainname_200910220908.sql.gz 10/22/2009 09:08:17 483,823 bytes Info

Download db_myusername_domainname_200910220931.sql.gz 10/22/2009 09:31:19 483,527 bytes Info

Download db_myusername_domainname_200910230836.sql.gz 10/23/2009 08:36:05 484,664 bytes Info

 

Also I can click on any backup in admin and download it, but if click on backup.log to D/L I get this error:

 

Error: Download link not acceptable.

 

Thanks

Share this post


Link to post
Share on other sites

not getting a cron auto archive backup

 

 

Unfortunatly the format for cron job commands does vary by server, you need to look through the docs for yours, or ask your host.

 

Some servers provide a test function to see if your new command works, but only some....


Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Share this post


Link to post
Share on other sites

Hi Sam,

 

I got the crom command from my host:

php /home/myusername/public_html/myadminfoldername/includes/auto_backup_db.php > /home/myusername/public_html/myadminfoldername/backups/backup.log

 

When it runs I get this in backup log

X-Powered-By: PHP/5.2.9

Content-type: text/html

 

<br />

<b>Warning</b>: include(includes/functions/refund_functions.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory in <b>/home/myusername/public_html/myadminfoldername/includes/functions/general.php</b> on line <b>1478</b><br />

<br />

<b>Warning</b>: include(includes/functions/refund_functions.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory in <b>/home/myusername/public_html/myadminfoldername/includes/functions/general.php</b> on line <b>1478</b><br />

<br />

<b>Warning</b>: include() [<a href='function.include'>function.include</a>]: Failed opening 'includes/functions/refund_functions.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in <b>/home/myusername/public_html/myadminfoldername/includes/functions/general.php</b> on line <b>1478</b><br />

<br />

<b>Warning</b>: require(includes/languages/add_ccgvdc_english.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in <b>/home/myusername/public_html/myadminfoldername/includes/languages/english.php</b> on line <b>335</b><br />

<br />

<b>Warning</b>: require(includes/languages/add_ccgvdc_english.php) [<a href='function.require'>function.require</a>]: failed to open stream: No such file or directory in <b>/home/myusername/public_html/myadminfoldername/includes/languages/english.php</b> on line <b>335</b><br />

<br />

<b>Fatal error</b>: require() [<a href='function.require'>function.require</a>]: Failed opening required 'includes/languages/add_ccgvdc_english.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in <b>/home/myusername/public_html/myadminfoldername/includes/languages/english.php</b> on line <b>335</b><br />

 

Also I can click on any backup in admin and download it, but if click on backup.log to D/L I get this error:

 

Error: Download link not acceptable.

 

I have tested the CCGV and it appears to be working fine>

 

Ideas please?

Share this post


Link to post
Share on other sites

 

 

That appears to be incidental errors your seeing in the log, none of those functions are used by this, have you checked your error logs to see if they occur at other times?

 

The log should not appear in the download list, its another bug in the default file that puts it there, upgrade to Database backup manager http://addons.oscommerce.com/info/5769


Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Share this post


Link to post
Share on other sites

Hi Sam,

I'm still having a problem getting the cron to run.

 

After getting the cron command from my host I now get this error in backup.log

 

<br />

<b>Fatal error</b>: Call to a member function add() on a non-object in <b>/home/myusername/public_html/myadminfoldername/includes/auto_backup_db.php</b> on line <b>127</b><br />

 

My host states:

The error is occurring because the code is trying to make use of the oscommerce message stack code but that code hasn't been declared.

It gets declared automatically when the script is ran manually but when run from cron, the programer has to make a point of declaring it, which it doesn't appear to have been done.

The backup part works though. I just tried it and you can see the backup was created.

So this isn't a problem with cron but is due to a problem in the contribution code.

 

Thanks

Share this post


Link to post
Share on other sites

 

OK, there are many message points, seems I missed one when I added the cron option blush.gif

 

find:

 

 	$messageStack->add('', 'none');
$messageStack->add('Deleted expired backup from ' . $filename, 'warning'); 

 

replace with:

 

 	if ($cron) { echo 'Deleted expired backup from ' . $filename . " \n\n"; } else {$messageStack->add('', 'none');
$messageStack->add('Deleted expired backup from ' . $filename, 'warning');    	}

Edited by spooks

Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Share this post


Link to post
Share on other sites

OK, there are many message points, seems I missed one when I added the cron option blush.gif

 

find:

 

 	$messageStack->add('', 'none');
$messageStack->add('Deleted expired backup from ' . $filename, 'warning'); 

 

replace with:

 

 	if ($cron) { echo 'Deleted expired backup from ' . $filename . " \n\n"; } else {$messageStack->add('', 'none');
$messageStack->add('Deleted expired backup from ' . $filename, 'warning');    	}

 

Hi Sam,

Thanks for this excellent contribution; it works like a charm.

Is there any possibility to define the number of backups or the expiation dat of the backups that will be kept? I would like to keep 3 backups at all times.

Regards,

Martina

Share this post


Link to post
Share on other sites

Hi Sam,

Thanks for this excellent contribution; it works like a charm.

Is there any possibility to define the number of backups or the expiation dat of the backups that will be kept? I would like to keep 3 backups at all times.

Regards,

Martina

 

 

This sort of thing has been asked quite a few times now, I will look at it, when I have a moment, but I would only include it as part of the cron job, not run any check every time. wink.gif


Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Share this post


Link to post
Share on other sites

This sort of thing has been asked quite a few times now, I will look at it, when I have a moment, but I would only include it as part of the cron job, not run any check every time. wink.gif

 

I have been busy creating something myself and am happy with it. Maybe it is of value to others.

I added a few lines in the beginning of auto_backup_db.php so it get the path that is needed when you call the file from cron:

// Include the neccesary files and settings

// Set the path to the osCommerce ADMIN catalog from this file

if (!isset($PHP_SELF)) $PHP_SELF = $_SERVER['PHP_SELF'];

$path = dirname($PHP_SELF);

$base = explode( "automatic",$PHP_SELF);

$path_rel = $base[0] . 'admin/';

 

and added a few lines at the end to purge the old files:

$dbfiles = 'db_' . DB_DATABASE. '*';

$execprgold = 'find '. $path_rel . ' -name ' . $dbfiles . ' -type f -mtime +' . BACKUP_KEEP . ' -exec rm -v {} \; >> ' . $path_rel . 'backups/purgebackups.log' ;

exec($execprgold);

 

Furthermore a new configuration item is needed: BACKUP_KEEP which says the number of days to keep backups (default 3):

INSERT INTO `configuration` ( `configuration_title`, `configuration_key`, `configuration_value`, `configuration_description`, `configuration_group_id`, `sort_order`, `last_modified`, `date_added`, `use_function`, `set_function`) VALUES
( 'Auto Backup Keep', 'BACKUP_KEEP', '3', 'How many days you wnat to keep bakcups', 12956, 4, '2009-11-09 17:13:33', '0000-00-00 00:00:00', NULL, NULL);

 

I put the auto_backup_db.php in a separate directory where exists an .htaccess file with only the ip adresses that can access this directory (my ipadresses, owner and hosting service).

The complete file to call with cron becomes:

<?php

/*

 $Id: auto_backup_db.php, v 3.0 24/09/2009 13:00:00 



 osCommerce, Open Source E-Commerce Solutions

 http://www.oscommerce.com



 Copyright (c) 2003 osCommerce



 Released under the GNU General Public License

*/


// Include the neccesary files and settings

 // Set the path to the osCommerce ADMIN catalog from this file 
if (!isset($PHP_SELF)) $PHP_SELF = $_SERVER['PHP_SELF'];  
$path = dirname($PHP_SELF);
$base = explode( "automatic",$PHP_SELF);  
$path_rel = $base[0] . 'admin/';  



// initialise database etc if cron job	

if(!defined('DB_DATABASE')) { 

		$cron = true;

           require ($path_rel . 'includes/configure.php');

	    require ($path_rel . 'includes/functions/database.php');

           tep_db_connect() or die('Unable to connect to database server!');

		require($path_rel.'includes/functions/general.php');

		require($path_rel.'includes/database_tables.php');

		include($path_rel.'includes/languages/dutch.php');

		$configuration_query = tep_db_query('select configuration_key as cfgKey, configuration_value as cfgValue from ' . TABLE_CONFIGURATION);

 		while ($configuration = tep_db_fetch_array($configuration_query)) {

  	  define($configuration['cfgKey'], $configuration['cfgValue']);

																																  }

														}



include($path_rel.'includes/languages/dutch/backup.php');

// set vars for php4

$at_backup_db = NULL;$saving = NULL;$zip = NULL;$gzip = NULL;$at_total = 0; 

// check if the backup directory exists

$at_dir_ok = false;

if (is_dir(DIR_FS_BACKUP)) {

if (is_writeable(DIR_FS_BACKUP)) {

	$at_dir_ok = true;

} else {

  if ($cron) { echo ERROR_BACKUP_DIRECTORY_NOT_WRITEABLE; } else {

  $messageStack->add_session('', 'none');

	$messageStack->add(ERROR_BACKUP_DIRECTORY_NOT_WRITEABLE, 'error');

} }

} else {

	if ($cron) { echo ERROR_BACKUP_DIRECTORY_DOES_NOT_EXIST; } else {

 $messageStack->add_session('', 'none');

$messageStack->add(ERROR_BACKUP_DIRECTORY_DOES_NOT_EXIST, 'error');

} }


// comment out if you cant get library installed

//if (BACKUP_ZIP == 'true') {

//require_once('PEAR.php');

//include ('Archive/Zip.php'); 

//}

// comment out if you cant get library installed



//create sort func

function Comp($a, $B)

{

return (strstr($a, DB_DATABASE) < strstr($b, DB_DATABASE)) ? -1 : 1;

}

// time

function microtime_float() {

   list($usec, $sec) = explode(" ",microtime());

   return ((float)$usec + (float)$sec);

}

//format

function str_format_number($String, $Format){

   if ($Format == '') return $String;

   if ($String == '') return $String;



   $Result = '';

   $FormatPos = 0;

   $StringPos = 0;

   While ((strlen($Format) - 1) >= $FormatPos){

       //If its a number => stores it

       if (is_numeric(substr($Format, $FormatPos, 1))){

           $Result .= substr($String, $StringPos, 1);

           $StringPos++;

       //If it is not a number => stores the caracter

       } Else {

           $Result .= substr($Format, $FormatPos, 1);

       }

       //Next caracter at the mask.

       $FormatPos++;

   }



   return $Result;

}



if ($at_dir_ok == true) {

$at_dir = dir(DIR_FS_BACKUP);

$at_contents = array();

while ($at_file = $at_dir->read()) {

	if (!is_dir(DIR_FS_BACKUP . $at_file)) {

		$at_contents[]=$at_file;

	}

}

if (sizeof($at_contents)) {

usort($at_contents, 'Comp');

$at_total = sizeof($at_contents)-1;

$at_entry = $at_contents[$at_total];

$at_last = ($at_total ? $at_contents[$at_total-1] : 0);

$at_ref_entry = $at_entry;

  $at_entry = strstr($at_entry, DB_DATABASE);

 	$at_entry = eregi_replace(DB_DATABASE . '[_-]', '', $at_entry);

	$at_entry = eregi_replace('[.a-z]', '', $at_entry);

	$at_last = strstr($at_last, DB_DATABASE);

	$at_last = eregi_replace(DB_DATABASE . '[_-]', '', $at_last);

	$at_last = eregi_replace('[.a-z]', '', $at_last);

	$at_current_date = strtotime(date('Y-m-d H:i'));

	$at_entry =($at_entry ? $at_entry : '200001010000');

	$at_last =($at_last ? $at_last : '200001010000');

	$format = '0000-00-00 00:00';

	$at_entry = str_format_number($at_entry, $format);

   $at_last = str_format_number($at_last, $format);

	$at_dif_date = ($at_current_date - strtotime($at_entry))/60;

	$at_last_date = ($at_current_date - strtotime($at_last))/60;

	$at_dir->close();



//Autobackup DB Calculo de hora FIN



//$messageStack->add_session('', 'none');

//$messageStack->add_session('Last backup ' . $at_dif_date . ' Minutes Ago, Previous backup ' . $at_last_date . ' Minutes Ago, Last file date read as ' . date("d-m-Y H:i", strtotime($at_entry)), 'success'); 

if($at_dif_date>BACKUP_INTERVAL) {

$at_backup_db = 'at_backupnow';$hr_dif = (int)($at_dif_date/60);$mn_dif = $at_dif_date-($hr_dif*60);

$saving = 'ATTENTION: Making a Auto-Backup of your Database ... ( ' . ($hr_dif ? $hr_dif . ' Hrs ' : '') . $mn_dif  . ' minutes since last backup ).';

if ($at_dif_date<(BACKUP_SAVE_INTERVAL * 60) && $at_last_date <(BACKUP_SAVE_INTERVAL * 60)) {$filename = DIR_FS_BACKUP . $at_ref_entry; 

		if ($at_ref_entry <> '') {

		unlink($filename);

       if ($cron) { echo 'Deleted expired backup from ' . $filename . " \n\n"; } else {$messageStack->add('', 'none');
       $messageStack->add('Deleted expired backup from ' . $filename, 'warning');      }			     }

		}

}



} else { $at_backup_db = 'at_backupnow';$saving = 'ATTENTION: Making the first Auto-Backup of your Database.';} 

} 



if (tep_not_null($at_backup_db)) {

 if ($cron) { echo date(PHP_DATE_TIME_FORMAT) . ' ' . $saving . " \n\n"; } else {

 $messageStack->add('', 'none');

$messageStack->add($saving, 'warning');

} 

switch ($at_backup_db) {

	case 'at_backupnow':

	tep_set_time_limit(0);$startSave = (float)microtime_float();

	$at_backup_file = 'db_' . DB_DATABASE . '_' . date('YmdHi') . '.sql';//BACKUP SAVE INTERVAL  BACKUP_INTERVAL

	if ($at_fp = fopen(DIR_FS_BACKUP . $at_backup_file, 'w')) {



	$tables_query = tep_db_query('show tables');

     while ($tables_result = tep_db_fetch_array($tables_query)) {

       foreach ($tables_result as $table_results_name) {

       $tables.= $table_results_name . ', ' ;

       }

	} $tables = substr_replace($tables, '', -2, 2);

	$at_schema = '#'. "\n" .

	'# Database Backup For ' . STORE_NAME . "\n" .

	'# Copyright (c) ' . date('Y') . ' ' . STORE_OWNER . "\n" .

	'#' . "\n" .

	'# Database: ' . DB_DATABASE . "\n" .

	'# Database Server: ' . DB_SERVER . "\n" .

	'#' . "\n" .

	'# Backup Date: ' . date(PHP_DATE_TIME_FORMAT) . "\n" .

	'# Backed up tables: ' . $tables . "\n\n";

	fputs($at_fp, $at_schema);

	$at_tables_query = tep_db_query('show tables');

	while ($at_tables = tep_db_fetch_array($at_tables_query)) {

		list(,$at_table) = each($at_tables);

		$at_schema = 'drop table if exists ' . $at_table . ';' . "\n" . 'create table ' . $at_table . ' (' . "\n";

		$at_table_list = array();

		$at_fields_query = tep_db_query("show fields from " . $at_table);

		while ($at_fields = tep_db_fetch_array($at_fields_query)) {

			$at_table_list[] = $at_fields['Field'];

			$at_schema .= '  ' . $at_fields['Field'] . ' ' . $at_fields['Type'];

			if (strlen($at_fields['Default']) > 0) $at_schema .= ' default \'' . $at_fields['Default'] . '\'';

			if ($at_fields['Null'] != 'YES') $at_schema .= ' not null';

			if (isset($at_fields['Extra'])) $at_schema .= ' ' . $at_fields['Extra'];

			$at_schema .= ',' . "\n";

		}

		$at_schema = ereg_replace(",\n$", '', $at_schema);

		// add the keys

		$at_index = array();

		$at_keys_query = tep_db_query("show keys from " . $at_table);

		while ($at_keys = tep_db_fetch_array($at_keys_query)) {

			$at_kname = $at_keys['Key_name'];

			if (!isset($at_index[$at_kname])) {

				$at_index[$at_kname] = array('unique' => !$at_keys['Non_unique'], 'columns' => array());

			}

			$at_index[$at_kname]['columns'][] = $at_keys['Column_name'];

		}

		while (list($at_kname, $at_info) = each($at_index)) {

			$at_schema .= ',' . "\n";

			$at_columns = implode($at_info['columns'], ', ');

			if ($at_kname == 'PRIMARY') {

				$at_schema .= '  PRIMARY KEY (' . $at_columns . ')';

			} elseif ($at_info['unique']) {

				$at_schema .= '  UNIQUE ' . $at_kname . ' (' . $at_columns . ')';

			} else {

				$at_schema .= '  KEY ' . $at_kname . ' (' . $at_columns . ')';

			}

		}

		$at_schema .= "\n" . ');' . "\n\n";

		fputs($at_fp, $at_schema);

		// dump the data

		$at_rows_query = tep_db_query("select " . implode(',', $at_table_list) . " from " . $at_table);

		while ($at_rows = tep_db_fetch_array($at_rows_query)) {

			$at_schema = 'insert into ' . $at_table . ' (' . implode(', ', $at_table_list) . ') values (';

			reset($at_table_list);

			while (list(,$at_i) = each($at_table_list)) {

				if (!isset($at_rows[$at_i])) {

					$at_schema .= 'NULL, ';

				} elseif (tep_not_null($at_rows[$at_i])) {

					$at_row = addslashes($at_rows[$at_i]);

					$at_row = ereg_replace("\n#", "\n".'\#', $at_row);

					$at_schema .= '\'' . $at_row . '\', ';

				} else {

					$at_schema .= '\'\', ';

				}

			}

			$at_schema = ereg_replace(', $', '', $at_schema) . ');' . "\n";

			fputs($at_fp, $at_schema);

		}

	}

	fclose($at_fp);$endSave = (float)microtime_float();$backuptime = round($endSave - $startSave, 2);

	} else { 

	if ($cron) { echo 'Error opening backup file for write,  please check backup directory permissions.'; } else {

  $messageStack->add('', 'none');

  $messageStack->add('Error opening backup file for write,  please check backup directory permissions.', 'warning');

    } }

	break;

}

if(file_exists(DIR_FS_BACKUP.$at_backup_file)){

  if (BACKUP_ZIP == 'gzip') bu_gzip (DIR_FS_BACKUP, $at_backup_file, true);

  if (method_exists('Archive_Zip','create')) {

	$archive = New Archive_Zip(DIR_FS_BACKUP.$at_backup_file.'.zip');

	$archive->create(DIR_FS_BACKUP.$at_backup_file); }

	if(file_exists(DIR_FS_BACKUP.$at_backup_file.'.zip')) { unlink(DIR_FS_BACKUP.$at_backup_file); $zip=true; $at_backup_file.='.zip';}

	if(file_exists(DIR_FS_BACKUP.$at_backup_file.'.gz')) { $gzip=true; $at_backup_file.='.gz';}

	$at_backup_db="ok";$ziptime= round((float)microtime_float() - $endSave, 2);

}

}

if($at_backup_db=="ok"){

$database_saved =' Database Backup completed in ' . $backuptime . ' secs' . ($zip ? ' and zipped in ' . $ziptime .' secs.' : ($gzip ? ' and gzipped in ' . $ziptime .' secs.' : '.'));

if ($cron) { echo $database_saved; } else {

$messageStack->add_session('', 'none');

$messageStack->add_session($database_saved.': <a href="backups/'.$at_backup_file.'" target="_blank"><blink><b>Check SQL</b></blink></a>', 'success');

} }  elseif ($cron) { echo date(PHP_DATE_TIME_FORMAT) . ' No chron job backup made, last backup made less than ' . BACKUP_SAVE_INTERVAL . ' mins ago.'; }

//AUTOBACKUP DB FIN

$dbfiles = 'db_' . DB_DATABASE. '*';
$execprgold = 'find '. $path_rel . '  -name ' . $dbfiles . '  -type f -mtime +' . BACKUP_KEEP . ' -exec rm -v {} \; >> ' . $path_rel  . 'backups/purgebackups.log' ;
exec($execprgold);

?>

 

It works for me.

Have fun.

Martine

Share this post


Link to post
Share on other sites

Thanks for that, my main concern would be the use of exec, although it makes the process easy (infact you could make a much smaller backup util using it) BUT on many servers the call is disabled for security (for good reason) and the whole basis of this is not to use any such calls.

 

 

I note you include in the code your admin dir name, as 'admin', I hope thats not really what your admin dir is called!! huh.gif

 

 

PS glad it works for you though smile.gif

 

 


Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Share this post


Link to post
Share on other sites

Hi Sam, thanks for this contribution, I've just installed and testing on php 5.3, therefore I'd like to ask you is you're planning update to get rid of "Deprecated"? My second question is bit more tricky, after installing Auto Backup, I'm unable to use the Site Monitor, because I'm receiving this Fatal Error:

Fatal error: Cannot redeclare microtime_float() (previously declared in /hosting/www/mystore.com/www/amin_to_be_or_not_to_be/includes/auto_backup_db.php:60)

 

Any solution?


Absinthe Original Liquor Store

Share this post


Link to post
Share on other sites

Hi Sam,

I just installed AutoBackup and it seems that this add on works just fine (except that www.one.com) doesn't support zip... :-(. BUT, since I also use SiteMonitor on your advise I got some problems after this install. Suddenly I can't execute SiteMonitor anymore. When using it I only get a blank screen, nothing more on the "reset" button. On the button for "Hacked files" I get a HTP500 error. Have you heard this before?

Share this post


Link to post
Share on other sites

conflict with sitemonitor contribution

 

 

 

It seems you have error display disabled in admin, a bad idea i think!!

 

 

issue raised b4:

 

sitemonitor contrib creates a function called microtime_float() which this also does, you need to change all instances of that name to something else, in one or the other. wink.gif


Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Share this post


Link to post
Share on other sites

It seems you have error display disabled in admin, a bad idea i think!!

 

You most probably corrcet Sam and now I spent >30 minutes in the manual and the forum to try to find out where this setting is. There are no other references as I have found, pleae give a small hint where I switch on error display. Thanks

Dan

Edited by DanLun

Share this post


Link to post
Share on other sites

It seems you have error display disabled in admin, a bad idea i think!!

 

You most probably corrcet Sam and now I spent >30 minutes in the manual and the forum to try to find out where this setting is. There are no other references as I have found, pleae give a small hint where I switch on error display. Thanks

 

Dan

 

PS I did find the place to change microtime_float() by looking on earlier postings (thanks I missed them before, didn't understand it was this error...) and I think its easiest in the "sitemonitor_functions.php" inside the admin/includes/functions library since its only there as it seems for testing purpose.

 

 

Share this post


Link to post
Share on other sites

enable error display in admin

 

I spent >30 minutes in the manual and the forum to try to find out where this setting is. There are no other references as I have found, pleae give a small hint where I switch on error display.

 

Find in includes/applicaion_top.php

 

// Turn off all error reporting
error_reporting(0);

 

replace with:

 

error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);


Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Share this post


Link to post
Share on other sites

Not sure where to start with this. I am running RC2a ant the latest ver of auto backup. Did set the cornjob up to run every minute. This will be changed once I know all is working. Also have the Backup Manager installed.

 

For my cornjob settings is * * * * * php /home/XXXXXXXXXX/public_html/admin_new_name/includes/auto_backup_db.php > /home/XXXXXXXXXX/public_html/admin_new_name/backups/backup.log which when run email is sent to email@email.com

 

Now I see the backups in tools -> database backup

 

auto backup settings is:

auto backup interval = 5 mins

backup save interval = 12 hrs again, this will be chaged once I know all is fine

bacup zip = gzip

 

I did contact host to verify correct command. Because nothing in email and my backup.log has the following:

X-Powered-By: PHP/5.2.9

Content-type: text/html

 

11/24/2009 11:20:02 No chron job backup made, last backup made less than 12 mins ago.

 

When host ran corn, they received this message:

php /home/XXXXXXXXX/public_html/admin_new_name/includes/auto_backup_db.php

 

Warning: require(../includes/functions/database.php): failed to open stream: No such file or directory in /home/XXXXXXXXX/public_html/admin_new_name/includes/auto_backup_db.php on line 17

 

Warning: require(../includes/functions/database.php): failed to open stream: No such file or directory in /home/XXXXXXXXX/public_html/admin_new_name/includes/auto_backup_db.php on line 17

 

Fatal error: require(): Failed opening required '../includes/functions/database.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/XXXXXXXXX/public_html/admin_new_name/includes/auto_backup_db.php on line 17

My host tells me I need to correct the path in the file. But I guess I do not see anything wrong!

 

Last question I like to ask. The 24 hrs for Backup Save interval, does that start from time contribution was installed or systems clock?

 

Thanks.

 

Bennett

Share this post


Link to post
Share on other sites

 

my backup.log has the following

 

X-Powered-By: PHP/5.2.9

Content-type: text/html

 

11/24/2009 11:20:02 No chron job backup made, last backup made less than 12 mins ago.

 

 

 

 

Please read the message, it means cron ran ok, but no backup needed as per settings. smile.gif


Sam

 

Remember, What you think I ment may not be what I thought I ment when I said it.

 

Contributions:

 

Auto Backup your Database, Easy way

 

Multi Images with Fancy Pop-ups, Easy way

 

Products in columns with multi buy etc etc

 

Disable any Category or Product, Easy way

 

Secure & Improve your account pages et al.

Share this post


Link to post
Share on other sites

enable error display in admin

 

 

 

Find in includes/applicaion_top.php

 

// Turn off all error reporting
error_reporting(0);

 

replace with:

 

error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED);

 

Great, thanks, I changed the one in /includes but didn't change the one in admin/includes. Correct? I did change from "error_reporting(E_ALL & ~E_NOTICE)" which is standard I assume becasue I havent changed this (if no add on done it). What does the last bit mean; ~E_DEPRECATED?

Edited by DanLun

Share this post


Link to post
Share on other sites

When I run the corn -> http://brs-giftshop.com/admin_new_name/includes/auto_backup_db.php, I get this though:

 

Error 403

Forbidden

You don't have permission to access /kramara/includes/auto_backup_db.php on this server.

 

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

 

The permission for auto_backup_db.php was set at 644, I assume that was done when installed. Do I need to change it to something like 755?

 

Bennett

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×