Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Developers' Forum

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 30th July 2012, 12:10
tom123 tom123 is offline
Member
 
Join Date: Feb 2012
Posts: 93
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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');
Reply With Quote
Sponsored Links
  #2  
Old 30th July 2012, 12:51
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,046
Thanks: 826
Thanked 5,388 Times in 4,233 Posts
Default

About which file / line are you talking?
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #3  
Old 30th July 2012, 12:56
tom123 tom123 is offline
Member
 
Join Date: Feb 2012
Posts: 93
Thanks: 0
Thanked 0 Times in 0 Posts
Default

cron_daily.php
Reply With Quote
  #4  
Old 30th July 2012, 13:09
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,046
Thanks: 826
Thanked 5,388 Times in 4,233 Posts
Default

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.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #5  
Old 30th July 2012, 13:11
tom123 tom123 is offline
Member
 
Join Date: Feb 2012
Posts: 93
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.
Reply With Quote
  #6  
Old 30th July 2012, 13:17
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,046
Thanks: 826
Thanked 5,388 Times in 4,233 Posts
Default

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.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #7  
Old 30th July 2012, 13:21
tom123 tom123 is offline
Member
 
Join Date: Feb 2012
Posts: 93
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by till View Post
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.
Reply With Quote
  #8  
Old 30th July 2012, 13:24
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,046
Thanks: 826
Thanked 5,388 Times in 4,233 Posts
Default

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.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #9  
Old 30th July 2012, 14:12
tom123 tom123 is offline
Member
 
Join Date: Feb 2012
Posts: 93
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by till View Post
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.
Reply With Quote
  #10  
Old 30th July 2012, 14:19
till till is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 36,046
Thanks: 826
Thanked 5,388 Times in 4,233 Posts
 
Default

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.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
I'm attack brute force qb7 General 6 21st July 2012 21:34
Problem with fetchmail/getmail brianetilley Installation/Configuration 3 27th January 2012 12:15
ISPConfig reports SMTP-server down, with Roundcube installed toffie Installation/Configuration 2 1st December 2011 10:55
Error show pages in server qb7 General 1 31st October 2011 09:09
get thousands of "Mailsize" mails from own server torusturtle Installation/Configuration 20 24th December 2006 14:51


All times are GMT +2. The time now is 20:26.


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