[BETA] Automatic Database backup

A place for MOD Authors to post and receive feedback on MODs still in development. No MODs within this forum should be used within a live environment! No new topics are allowed in this forum.
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: MOD Development Forum rules

On February 1, 2009 this forum will be set to read only as part of retiring of phpBB2.
kkroo
Registered User
Posts: 729
Joined: Sat Dec 03, 2005 4:49 pm
Contact:

Post by kkroo » Sun Dec 17, 2006 8:07 pm

This has nothing to do with the database size. Because the backup is initiated by user activity, it may not be exactly on time. The busier your board, the closer it will be to the actual time.
My MODs

Need a coder?

Enjoy my Mods? - Image

keyhosting.co.uk
Registered User
Posts: 9
Joined: Mon Nov 20, 2006 8:47 pm

Post by keyhosting.co.uk » Sun Dec 17, 2006 8:13 pm

Fantastic that is a lot more clear thanks you. so I take it that it is set off by the addition of posts or changes to the content in some way. one last question then does it que the jobs or will it just trigger the generation of the last backup when this happens?

keyhosting.co.uk
Registered User
Posts: 9
Joined: Mon Nov 20, 2006 8:47 pm

Post by keyhosting.co.uk » Mon Dec 18, 2006 7:54 pm

Sorry I have now got more problems. Thought that I should probably check to make sure that the backups that are stored will actually restore. When I did this I went in to the admin pannel clicked on restore backup and got the following message.

Error importing backup file

DEBUG MODE

SQL Error : 1050 Table 'phpbb_auth_access' already exists

CREATE TABLE `phpbb_auth_access`( group_id mediumint(8) NOT NULL, forum_id smallint(5) unsigned NOT NULL, auth_view tinyint(1) NOT NULL, auth_read tinyint(1) NOT NULL, auth_post tinyint(1) NOT NULL, auth_reply tinyint(1) NOT NULL, auth_edit tinyint(1) NOT NULL, auth_delete tinyint(1) NOT NULL, auth_sticky tinyint(1) NOT NULL, auth_announce tinyint(1) NOT NULL, auth_vote tinyint(1) NOT NULL, auth_pollcreate tinyint(1) NOT NULL, auth_attachments tinyint(1) NOT NULL, auth_mod tinyint(1) NOT NULL, KEY group_id (group_id), KEY forum_id (forum_id) )

Line : 980
File : admin_db_utilities.php


Not being all that clued up on the error codes I am not really sure what this means althoug I am taking it forgranted that because the tables already exist they cannot be overwritten or something. Can anyone please help me to find a work around or tell me what I am doing wrong. thanks for your help.

kkroo
Registered User
Posts: 729
Joined: Sat Dec 03, 2005 4:49 pm
Contact:

Post by kkroo » Tue Dec 19, 2006 12:56 pm

You are getting this error because the database already exists. To restore it, you may want to delete the table before restoring it or else you will get that error because it is already there.
My MODs

Need a coder?

Enjoy my Mods? - Image

keyhosting.co.uk
Registered User
Posts: 9
Joined: Mon Nov 20, 2006 8:47 pm

Post by keyhosting.co.uk » Tue Dec 19, 2006 5:09 pm

Thanks I thought as much but like I said never sure wether or not to start messing around with the DB until I know that is what I need to do.

Thanks again for all your help

User avatar
Volunteer Forum
Registered User
Posts: 400
Joined: Mon Sep 12, 2005 9:59 pm

Post by Volunteer Forum » Sun Dec 31, 2006 11:56 am

Today my my site did not load properly anytime cause of the:
img src="cron.php" thing..

I removed it temporarily, but i wonder whats wrong with it =/
Everything that is not perfect is a flaw [",]

Peter77sx
Registered User
Posts: 3257
Joined: Wed Nov 09, 2005 2:51 pm

Post by Peter77sx » Sun Dec 31, 2006 12:13 pm

kkroo, I do not know how it's making backups of my phpbb SQL without the "cron.php" in my footer, but the past few weeks, it's been making and sending them to my email account. I don't think it's shutting the board down though.

kdtcat
Registered User
Posts: 8
Joined: Tue Nov 22, 2005 1:32 pm
Location: Wiesbaden, Germany

Post by kdtcat » Sun Dec 31, 2006 1:17 pm

Today my my site did not load properly anytime cause of the:
img src="cron.php" thing..


Same with my site ... httpd threads run forever. I changed Cron to all * and disabled backups to circumvent the problem.

I guess something is running wrong because of date= 31.12. ???
have a nice day

Wingzfan
Registered User
Posts: 441
Joined: Wed Jan 25, 2006 4:55 pm

Post by Wingzfan » Sun Dec 31, 2006 7:30 pm

Is there any possibility of this also backing up files and folders? Most times I need a restore is after some crappy hack attempt. Ive only ever had to restore the index.php and the config.php. Just curious if its possible to backup all phpbb folders.

Ultima-X97
Registered User
Posts: 157
Joined: Sat Sep 16, 2006 2:49 pm

Post by Ultima-X97 » Mon Jan 01, 2007 4:12 am

Yes i am also having a problem in which the index.php page never fully loads. This causes major stress on the servers CPU and creates alot of damage. What should i do to fix it?

Electra736
Registered User
Posts: 270
Joined: Fri Aug 11, 2006 4:25 pm

Post by Electra736 » Mon Jan 01, 2007 4:24 am

Kkroo, version 1.0.0 of your MOD is not working properly at all. It never obeys the number of backups to be kept limit. On top of that, it generates several backups a day. Your MOD caused major problems and my site got suspended 3 times. I'll show you the proof for the recent server failure.

Code: Select all

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
32549 admin 39 19 13824 5896 3324 R 5.7 0.2 0:37.29 /usr/bin/php cron.php
2710 admin 39 19 13828 5900 3324 R 5.7 0.2 0:20.45 /usr/bin/php cron.php
9404 admin 39 19 13824 5896 3324 R 5.7 0.2 0:03.91 /usr/bin/php cron.php
9734 root 16 0 2424 1388 804 R 5.7 0.0 0:02.14 top
32236 admin 39 19 13824 5896 3324 R 4.8 0.2 1:02.35 /usr/bin/php cron.php
32271 admin 39 19 13828 5900 3324 R 4.8 0.2 0:56.12 /usr/bin/php cron.php
32297 admin 39 19 13892 5896 3324 R 4.8 0.2 0:40.75 /usr/bin/php cron.php
32323 admin 39 19 13824 5896 3324 R 4.8 0.2 0:45.32 /usr/bin/php cron.php
32475 admin 39 19 13824 5896 3324 R 4.8 0.2 0:47.81 /usr/bin/php cron.php
32511 admin 39 19 13828 5900 3324 R 4.8 0.2 0:49.84 /usr/bin/php cron.php
1370 admin 39 19 13872 5904 83876k used, 4009048k free, 2287120k cached
7969 admin 39 19 13820 5892 3324 R 3.7 0.2 0:19.02 /usr/bin/php cron.php
32035 admin 39 19 13868 5904 3332 R 2.8 0.2 1:45.88 /usr/bin/php cron.php
32236 admin 39 19 13824 5896 3324 R 2.8 0.2 1:02.30 /usr/bin/php cron.php
32242 admin 39 19 13868 5904 3332 R 2.8 0.2 0:58.81 /usr/bin/php cron.php
32271 admin 39 19 13828 5900 3324 R 2.8 0.2 0:56.07 /usr/bin/php cron.php
32310 admin 39 19 13824 5896 3324 R 2.8 0.2 0:45.18 /usr/bin/php cron.php
32323 admin 39 19 13824 5896 3324 R 2.8 0.2 0:45.27 /usr/bin/php cron.php
32349 admin 39 19 13824 5896 3324 R 2.8 0.2 0:43.19 /usr/bin/php cron.php
32411 admin 39 19 13824 5896 3324 R 2.8 0.2 0:49.36 /usr/bin/php cron.php
32429 admin 39 19 13828 5896 3324 R 2.8 0.2 0:52.10 /usr/bin/php cron.php
32441 admin 39 19 13824 5896 3324 R 2.8 0.2 0:49.72 /usr/bin/php cron.php
32475 admin 39 19 13824 5896 3324 R 2.8 0.2 0:47.76 /usr/bin/php cron.php
32511 admin 39 19 13828 5900 3324 R 2.8 0.2 0:49.79 /usr/bin/php cron.php
32536 admin 39 19 13824 5896 3324 R 2.8 0.2 0:46.16 /usr/bin/php cron.php
32604 admin 39 19 13824 5896 3324 R 2.8 0.2 0:38.93 /usr/bin/php cron.php
376 admin 39 19 13820 5892 3324 R 2.8 0.2 0:55.07 /usr/bin/php cron.php
1370 admin 39 19 13872 5904 3332 R 2.8 0.2 0:50.84 /usr/bin/php cron.php
1389 admin 39 19 13824 5892 3324 R 2.8 0.2 0:43.99 /usr/bin/php cron.php
1676 admin 39 19 13824 5896 3324 R 2.8 0.2 0:46.82 /usr/bin/php cron.php
1894 admin 39 19 13824 5896 3324 R 2.8 0.2 0:44.78 /usr/bin/php cron.php
1923 admin 39 19 13828 5900 3324 R 2.8 0.2 0:39.23 /usr/bin/php cron.php
1946 admin 39 19 13824 5896 3324 R 2.8 0.2 0:38.61 /usr/bin/php cron.php
See, it was making so many backups at the same time. Actually, v8.1 of the MOD is 10 times better. I de-upgraded from 1.0.0 to 8.1 for now.

So will it be possible for you to fix your MOD?

Thanks.

normcdn
Registered User
Posts: 8
Joined: Sun Aug 27, 2006 11:25 pm
Location: Montreal, Quebec, Canada

Post by normcdn » Fri Jan 05, 2007 4:04 pm

I used this script for a month or so and everything was fine. This is a very usefull script for backing up my databases. Few days ago I received a warning from my web hosting about a CPU overload and they shut down my account. :cry:
At first, I did not know why but they sent me an email with more infos and I got the same as Electra736 regarding the cron.php generating too much CPU. So I removed the image cron.php in simple_footer.tpl and overall_footer.tpl. Now the server works.
Presently I have to make the backup myself using phpMyAdmin which is a pain in the neck. I do not know the nature of the problem but I would really love to know a way to fix it.

I also had the problem of multiple backups. I did not find the cause of this problem BUT I found a way to prevent this, I modified the code that creates the name of the backup by removing the hour and minute. So this way even if it creates multiple backups, it will always overwrite the existing one (only if you make one backup a day like I do every midnight).
Hope kkro will be able to fix the CPU overload problem. He does a very good job with this script.
Thanks.
Normand

Wingzfan
Registered User
Posts: 441
Joined: Wed Jan 25, 2006 4:55 pm

Post by Wingzfan » Fri Jan 05, 2007 5:17 pm

Wingzfan wrote: Is there any possibility of this also backing up files and folders? Most times I need a restore is after some crappy hack attempt. Ive only ever had to restore the index.php and the config.php. Just curious if its possible to backup all phpbb folders.


anyone think this is possible?

killyouall
Registered User
Posts: 523
Joined: Tue Oct 18, 2005 3:04 am
Contact:

Post by killyouall » Fri Jan 05, 2007 5:22 pm

can this do the entire directory including the sql?

also can you seprate the times? like on tues make it back up the files the on fri it does the sql

Wingzfan
Registered User
Posts: 441
Joined: Wed Jan 25, 2006 4:55 pm

Post by Wingzfan » Fri Jan 05, 2007 6:13 pm

as of right now it only backs up the sql and not the files or folders. Im hoping someone will make that happen.

Post Reply

Return to “[2.0.x] MODs in Development”