
30th July 2012, 12:10
|
|
Member
|
|
Join Date: Feb 2012
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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');
|

30th July 2012, 12:51
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,911
Thanks: 693
Thanked 4,196 Times in 3,212 Posts
|
|
About which file / line are you talking?
|

30th July 2012, 12:56
|
|
Member
|
|
Join Date: Feb 2012
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
cron_daily.php
|

30th July 2012, 13:09
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,911
Thanks: 693
Thanked 4,196 Times in 3,212 Posts
|
|
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.
|

30th July 2012, 13:11
|
|
Member
|
|
Join Date: Feb 2012
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|

30th July 2012, 13:17
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,911
Thanks: 693
Thanked 4,196 Times in 3,212 Posts
|
|
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.
|

30th July 2012, 13:21
|
|
Member
|
|
Join Date: Feb 2012
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
Originally Posted by till
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.
|

30th July 2012, 13:24
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,911
Thanks: 693
Thanked 4,196 Times in 3,212 Posts
|
|
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.
|

30th July 2012, 14:12
|
|
Member
|
|
Join Date: Feb 2012
Posts: 76
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Quote:
Originally Posted by till
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.
|

30th July 2012, 14:19
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 31,911
Thanks: 693
Thanked 4,196 Times in 3,212 Posts
|
|
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.
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +2. The time now is 23:10.
|
Recent comments
23 hours 17 min ago
23 hours 23 min ago
1 day 4 hours ago
1 day 11 hours ago
1 day 11 hours ago
1 day 13 hours ago
1 day 17 hours ago
2 days 3 min ago
2 days 3 hours ago
2 days 5 hours ago