HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Developers' Forum (http://www.howtoforge.com/forums/forumdisplay.php?f=33)
-   -   SVN: web backups (http://www.howtoforge.com/forums/showthread.php?t=58123)

tom123 30th July 2012 12:10

SVN: web backups
 
I'm looking at the latest SVN trunk.
How can web backup works in a multi server setups?
The client doesn't have write access to sys_datalog and web_backup tables so the following query will always fail:

Code:

//* Insert web backup record in database
$insert_data = "(server_id,parent_domain_id,backup_type,backup_mode,tstamp,filename) VALUES (".$conf['server_id'].",".$web_id.",'web','".$backup_mode."',".time().",'".$app->db->quote($web_backup_file)."')";
$app->dbmaster->datalogInsert('web_backup', $insert_data, 'backup_id');


till 30th July 2012 12:51

About which file / line are you talking?

tom123 30th July 2012 12:56

cron_daily.php

till 30th July 2012 13:09

Ok, I will check that. The new permission scheme is not added yet to the installer, so it might be that some tables are not accessible yet.

tom123 30th July 2012 13:11

I've added SELECT,INSERT,DELETE grants to web_backup table, but I don't see any grant for sys_datalog.

Is sys_datalog supposed to be different between master and client ?
Actually, backup entries are stored on the client only.

till 30th July 2012 13:17

I've added a report for the bugtracker for this and we will review it until 3.0.5 gets released. The sys_datalog is used to sync information between master and client and the information about the backups are needed o master and client.

tom123 30th July 2012 13:21

Quote:

Originally Posted by till (Post 282979)
I've added a report for the bugtracker for this and we will review it until 3.0.5 gets released. The sys_datalog is used to sync information between master and client and the information about the backups are needed o master and client.

Ok, but sys_datalog can be different between master and client ?
The actual cron will write only to the client, seems to work because i'm able to see the backup list from the interface, but on the master there is no reference to these backups.

I don't know why master should have the client backup list, maybe that the actual script is good as it is.

till 30th July 2012 13:24

Quote:

Ok, but sys_datalog can be different between master and client ?
Yes. The sys_datalog of the master contains all records for all clients while the sys_datalog of a client contains only record that are required by this specific client.

Quote:

The actual cron will write only to the client, seems to work because i'm able to see the backup list from the interface, but on the master there is no reference to these backups.
And thats the reason why the code writes to the dbmaster and not the local db api, if you change it to the local db, you cant see any reference on the master.

tom123 30th July 2012 14:12

Quote:

Originally Posted by till (Post 282981)
And thats the reason why the code writes to the dbmaster and not the local db api, if you change it to the local db, you cant see any reference on the master.

Ok, in this case, the backup script is working properly because the client calls
Code:

$app->dbmaster->datalogInsert('web_backup', $insert_data, 'backup_id');
datalogInsert will do the insert and then calls datalogSave that will write on "db" and not on "dbmaster".

In this way, the backup item is wrote properly on sys_datalog on the client and never on the master.

If this is correct, cron script is working properly.

till 30th July 2012 14:19

There is a error in the mysql library indeed, thansk for pointing that out. Ine the datalogSave function, it has to be:

$this->query($sql);

instead of:

$app->db->query($sql);

and the two quote calls should be also to $this. I fixed that in svn. It currently works but it was not intended this way and I had not noticed it cause it worked. I will check the issue regarding permissions.


All times are GMT +2. The time now is 13:37.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.