Jump to content


Corporate Sponsors


Latest News: (loading..)

* * * * * 1 votes

Contribution: Auto Backup Database


159 replies to this topic

#101 spooks

  • Community Member
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 24 November 2009, 22:00

View Postblr044, on 24 November 2009, 21:25, said:

When I run the corn -> http://brs-giftshop....o_backup_db.php, I get this though:



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


more likely an issue with your htaccess, check there
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.

#102 fruchtge

  • Community Member
  • 15 posts
  • Real Name:Jens Honda
  • Gender:Male
  • Location:Berlin

Posted 24 November 2009, 23:18

View Postspooks, on 24 November 2009, 22:00, said:

more likely an issue with your htaccess, check there

Hi folks,

I have the same problem ;-) it is because a htacces password protection. Is there an ability to add password in path to dingsbum_backup.php ?
life long and knusper

#103 nkarafo

  • Community Member
  • 20 posts
  • Real Name:Nikos
  • Gender:Male
  • Location:Greece, Athens

Posted 26 November 2009, 13:18

I'm sorry but I haven't fully understand the auto backup contribution. I have installed it and I have changed the "Auto Backup Interval" settings to every one minute. The "Backup Save Interval" is 24 hours. "Backup zip" is false.

So, when I am logging as admin, nothing is happening. I should have a backup in the server's folder /admin/backups but it's empty. I have set the folder options to "777" but still nothing. Only the osc embedded admin backup is working (manually). Is there also an option to have every day an automatic backup even we don't log in as admin?

Thank you.

#104 spooks

  • Community Member
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 26 November 2009, 14:05

No backup on lgin

View Postnkarafo, on 26 November 2009, 13:18, said:


So, when I am logging as admin, nothing is happening. ).



how r u logging in to admin, with htaccess by any chance? please read the doc. [img]http://forums.oscommerce.com/public/style_emoticons/default/wink.gif[/img]


Quote

Is there also an option to have every day an automatic backup even we don't log in as admin?

Thats what the cron option is for. [img]http://forums.oscommerce.com/public/style_emoticons/default/smile.gif[/img]


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.

#105 mr_absinthe

  • Community Member
  • 411 posts
  • Real Name:Alex
  • Location:London, UK

Posted 29 November 2009, 08:56

Deprecated problem remains... any updates on this?
Absinthe Original Liquor Store

#106 jfkafka

  • Community Member
  • 161 posts
  • Real Name:john kafka

Posted 16 December 2009, 18:23

View Postspooks, on 04 November 2009, 10:06, said:

OK, there are many message points, seems I missed one when I added the cron option [img]http://forums.oscommerce.com/public/style_emoticons/default/blush.gif[/img]

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,
(I consolidated three areas of confusion so as to expedite any
solutions- hope you don't mind this shopping list)

Firstly, Thanks very much for the auto db backup contribution-
it works flawlessly and provides welcome peace of mind- the only
snafu is that the old backups are accumulating and I haven't
managed to pinpoint where I messed up-

1. Does anything suggest itself as to how to remedy accumulating db backups?

2. Should auto_backup_setup.php be deleted after running it (some contributions
mention removing similar types of sql install files and I've learned not to assume too often)

Question regarding Database_backup_manager, is the screen supposed to go blank after making a backup?
specifically after hitting the backup button in Database Backup Manager and waiting a few seconds the url adds NOW to the end of the querystring;

https://mysite.com/admin folder/backup.php?action=backupfilesnow

and the screen goes blank, in the bottom left corner is the word: Done

3. Should there be something displayed in the blank area?
(I just hit the back button to return to the Database Backup Manager)

Before asking that question I tried your link from the install text of Database_backup_manager_v1.4 but it appears to be a DEAD LINK?

"At the moment (June 2008) there appears to be a problem in certain situations where the list of checkboxes
with all the tables you want to backup is not completely transfered by the post protocol
(see Sam/spooks post: http://forums.oscommerce.com/index.php?s=&showtopic=293949&view=findpost&p=1256514 ).
I haven't been able to replicate that error on my computer so don't know if it is an issue with either the PHP version, server, or browser."
- from Database_backup_manager_v1.4 INSTALL TEXT

Lastly regarding the code update quoted at the top of the post:
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');    	}

3. Where is this code located? (I looked in includes/auto_backup_db.php but the closest I could find was:

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

($messageStack->add_session NOT $messageStack->add)

Thanks for your patience and expertise regarding any of the above,

jk

#107 spooks

  • Community Member
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 16 December 2009, 18:56

View Postjfkafka, on 16 December 2009, 18:23, said:



2. Should auto_backup_setup.php be deleted after running it (some contributions
mention removing similar types of sql install files and I've learned not to assume too often)



Its says in instructions!!

3 etc Database_backup_manager has its own support thread

1. delete with ftp
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.

#108 jfkafka

  • Community Member
  • 161 posts
  • Real Name:john kafka

Posted 16 December 2009, 23:04

Hi Sam,

Thanks for your swift reply.

Just to recap:
1. Use ftp to delete auto db backups. affirmative
2. It says in instructions! little fuzzy on this...
Here are the last two instructions (5 + 6) on my copy of (Auto Backup Install V2.8)
5. In /admin/includes/languages/english.php
before the last ?> add:
define('ERROR_BACKUP_DIRECTORY_DOES_NOT_EXIST','Error, Backup Directory Does Not Exist,
please create it or run "auto_backup_setup.php"');

6. ensure you have already logged into your site, then goto the setup page by pasting
into the url something like www.mysite.com/catalog/admin/auto_backup_setup.php
it will add the settings to the database & create the backup directory if needed.
its normally at catalog/admin/backups.

The defined variable in auto_backup_db.php are standard, so nothing further needed.
- end of instructions

I mention this in case my copy of the instructions is
somehow different and missing the part about deleting
auto_backup_setup.php after executing the sql insert-
I had theorized that maybe it was needed in the course
of doing the periodic automatic backups- glad to have
clarified that it should be deleted once configured.

3. "sorry wrong number"

that only leaves the last bit regarding a code update and if I did somehow
not get the complete instructions on deleting the auto_backup_setup.php
maybe other parts are missing as well like the segment below

$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'); }

(I looked in includes/auto_backup_db.php but the closest I could find was:

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

NOTE: $messageStack->add_session (NOT $messageStack->add like your code)

In which file is: $messageStack->add('', 'none');
$messageStack->add('Deleted expired backup from ' . $filename, 'warning');
located?
Or should the code be modified replacing the instances of $messageStack->add
with $messageStack->add_session?

Thanks for your understanding and assistance,
jk

#109 mr_absinthe

  • Community Member
  • 411 posts
  • Real Name:Alex
  • Location:London, UK

Posted 26 January 2010, 21:16

Sam, would you please help me with changing the code from eregi_replace to preg_match?

I've managed to change it almost in the whole file, for example

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

new
$at_entry = preg_match('/[.a-z]/i', '', $at_entry);

However I'm struggling with these lines
$at_entry = eregi_replace(DB_DATABASE . '[_-]', '', $at_entry);

changing it to
$at_entry = preg_match(DB_DATABASE . '/[_-]/i', '', $at_entry);
does not seem to work, still receiving Warning: preg_match(): Delimiter must not be alphanumeric or backslash in /hosting/www/store/www/admin/includes/auto_backup_db.php on line 103
Absinthe Original Liquor Store

#110 spooks

  • Community Member
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 26 January 2010, 22:16

View Postmr_absinthe, on 26 January 2010, 21:16, said:

Sam, would you please help me with changing the code from eregi_replace to preg_match?

I've managed to change it almost in the whole file, for example

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

new
$at_entry = preg_match('/[.a-z]/i', '', $at_entry);

However I'm struggling with these lines
$at_entry = eregi_replace(DB_DATABASE . '[_-]', '', $at_entry);

changing it to
$at_entry = preg_match(DB_DATABASE . '/[_-]/i', '', $at_entry);
does not seem to work, still receiving Warning: preg_match(): Delimiter must not be alphanumeric or backslash in /hosting/www/store/www/admin/includes/auto_backup_db.php on line 103

you have errors with both!!

$at_entry = eregi_replace('[.a-z]', '', $at_entry);
would be replaced with:

$at_entry = preg_replace('/[.a-z]/i', '', $at_entry);

and

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

would be replaced with:

$at_entry = preg_replace('/' . DB_DATABASE . '[_-]/i', '', $at_entry);
[img]http://forums.oscommerce.com/public/style_emoticons/default/smile.gif[/img]


PS perhaps u can answer a query of mine, ith genuine absinthe, should it be clear after adding water? [img]http://forums.oscommerce.com/public/style_emoticons/default/huh.gif[/img]
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.

#111 mr_absinthe

  • Community Member
  • 411 posts
  • Real Name:Alex
  • Location:London, UK

Posted 27 January 2010, 10:15

View Postspooks, on 26 January 2010, 22:16, said:

you have errors with both!!

$at_entry = eregi_replace('[.a-z]', '', $at_entry);
would be replaced with:

$at_entry = preg_replace('/[.a-z]/i', '', $at_entry);

and

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

would be replaced with:

$at_entry = preg_replace('/' . DB_DATABASE . '[_-]/i', '', $at_entry);
[img]http://forums.oscommerce.com/public/style_emoticons/default/smile.gif[/img]


PS perhaps u can answer a query of mine, ith genuine absinthe, should it be clear after adding water? [img]http://forums.oscommerce.com/public/style_emoticons/default/huh.gif[/img]
Certainly not a good idea to try some coding with fever ;-) and I wish my learning curve was steeper. I hope that I've got it right this time - it appears to be working fine. New code on lines 103 - 109 (approximately):
	 	$at_entry = preg_replace('/' . DB_DATABASE . '[_-]/i', '', $at_entry);
    	        $at_entry = preg_replace('/[.a-z]/i', '', $at_entry);
		
		$at_last = strstr($at_last, DB_DATABASE);
		
		$at_last = preg_replace('/' . DB_DATABASE . '[_-]/i', '', $at_last);
		$at_last = preg_replace('/[.a-z]/i', '', $at_last);

next is line 183 (I've kept the commented line to make it easier to follow)
//			$at_schema = ereg_replace(",\n$", '', $at_schema);
			$at_schema = preg_replace("/,\n$/", '', $at_schema);

lines 218 - 226
//						$at_row = ereg_replace("\n#", "\n".'\#', $at_row);
						$at_row = preg_replace("/\n#/", "\n".'\#', $at_row);	
						$at_schema .= '\'' . $at_row . '\', ';
					} else {
						$at_schema .= '\'\', ';
					}
				}
//				$at_schema = ereg_replace(', $', '', $at_schema) . ');' . "\n";
				$at_schema = preg_replace('/, $/', '', $at_schema) . ');' . "\n";

Edited by Jan Zonjee, 27 January 2010, 22:05.
thanks for not using the osC forums to spam your shop

Absinthe Original Liquor Store

#112 mr_absinthe

  • Community Member
  • 411 posts
  • Real Name:Alex
  • Location:London, UK

Posted 29 January 2010, 18:35

View Postspooks, on 26 January 2010, 22:16, said:

PS perhaps u can answer a query of mine, ith genuine absinthe, should it be clear after adding water? [img]http://forums.oscommerce.com/public/style_emoticons/default/huh.gif[/img]
Since my reply was edited / deleted, I can send you PM if you like. <_<
Absinthe Original Liquor Store

#113 spooks

  • Community Member
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 29 January 2010, 18:56

View Postmr_absinthe, on 29 January 2010, 18:35, said:

Since my reply was edited / deleted, I can send you PM if you like. [img]http://forums.oscommerce.com/public/style_emoticons/default/dry.gif[/img]


Hi, its OK I did read it b4, seems Jan is beiing a bit sevear there, perhaps he did'nt spot it was a reply!! You had'nt put any links either!!! [img]http://forums.oscommerce.com/public/style_emoticons/default/ohmy.gif[/img]


Thanks for the info though. [img]http://forums.oscommerce.com/public/style_emoticons/default/smile.gif[/img]
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.

#114 sarafina

  • Community Member
  • 108 posts
  • Real Name:Sandrine

Posted 23 February 2010, 15:05

If we have autobackups on a cron job, does the cron job overide the admin settings or do they work together? I have cron job to create a db backup every 6 hours..but I have the admin setting as default..(autobackup interval 20 mins, autosave interval 24hrs)

Should I synch them or does it not matter?

Also I re-read the instructions and it doesn't clearly say whether or not to delete auto_backup_setup.php so can you clarify if we should delete this?
Contributions installed: Purchase without Account / STS/ All Products/ Header Tags Controller

#115 spooks

  • Community Member
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 23 February 2010, 17:39

View Postsarafina, on 23 February 2010, 15:05, said:


Should I synch them or does it not matter?



No , it does not matter, its automatic, if the cron job happens just after a backup & within your set time limits, it will skip the job.

Quote

Also I re-read the instructions and it doesn't clearly say whether or not to delete auto_backup_setup.php so can you clarify if we should delete this?
Yes, delete auto_backup_setup.php
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.

#116 Whiskers

  • Community Member
  • 355 posts
  • Real Name:Nick
  • Gender:Male
  • Location:Norfolk, UK

Posted 27 March 2010, 12:48

Hiya,

Is there any conflicts with this if I rename admin?

#117 spooks

  • Community Member
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 27 March 2010, 13:58

View PostWhiskers, on 27 March 2010, 12:48, said:

Is there any conflicts with this if I rename admin?


no
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.

#118 Whiskers

  • Community Member
  • 355 posts
  • Real Name:Nick
  • Gender:Male
  • Location:Norfolk, UK

Posted 27 March 2010, 15:55

View Postspooks, on 27 March 2010, 13:58, said:

no

Great, thanks.

#119 sarafina

  • Community Member
  • 108 posts
  • Real Name:Sandrine

Posted 03 May 2010, 20:26

I tried setting up this on a cron job and it doesn't work. I got an email notification with this:
/bin/sh: line 1: /root/public_html/admin/backups/backup.log: Permission denied

Any clue what I did wrong?

My store is hosted in the root domain btw.

Edited by sarafina, 03 May 2010, 20:27.

Contributions installed: Purchase without Account / STS/ All Products/ Header Tags Controller

#120 spooks

  • Community Member
  • 7,017 posts
  • Real Name:Sam
  • Gender:Male
  • Location:UK

Posted 05 May 2010, 22:22

View Postsarafina, on 03 May 2010, 20:26, said:

I tried setting up this on a cron job and it doesn't work. I got an email notification with this:
/bin/sh: line 1: /root/public_html/admin/backups/backup.log: Permission denied

Any clue what I did wrong?

My store is hosted in the root domain btw.


Cron job setups vary by server, if you have any issues there speak to your hosts, I`ve tested on a variety of servers & barring variations required by each, I`ve seen no issues.
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.