Web backups

Discussion in 'Developers' Forum' started by tio289, Nov 6, 2012.

  1. tio289

    tio289 Member

    Hello, I on latest SVN version and I try to use web backups. I set period "daily" and copies to "7".

    When I look on disk, backups was created, but not inserted in DB web_backup table. I added logs to cron_daily.php and it generate sql queries, which are correct. Problem is probably in $app->db, which not execute these queries.

    Many times it insert only query for 1. web, other time for first 5 webs...If some queries is inserted, them it inserted two times, because was called $app->db and $app->dbmaster. So I solve this problem by comment out $app->dbmaster .

    First problem persists.
     
    Last edited: Nov 7, 2012
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    This has been fixed already in the current beta which is available in this forum, the svn trunk which you seemed to use does not contain latest code for the 3.0.5 release. If you want to get the latest code, then check out the stable branch for the 3.0.5 release.
     
  3. tio289

    tio289 Member

    Hi, I switch on ispconfig-3.0.5 branch, duplicate entries was solved, but my firsts problem persists.
     
  4. till

    till Super Moderator Staff Member ISPConfig Developer

    It works here on my test server. Is this a multiserver system? If yes, did you choose to reconfigure permissions on master server during update?
     
  5. Croydon

    Croydon ISPConfig Developer ISPConfig Developer

    It works on my servers (multiserver setup), too. So I think it might really be a permission problem.
     
  6. tio289

    tio289 Member

    Hi guys, I was finally figure out problem:

    it was with mysql connection timeout. I set wait_timeout and interactive_timeout to small values (60s), because many sites,cms etc. don't correctly close connections.

    ispconfig backup script is running long time and mysql close connection. So I contribute path:

    /usr/local/ispconfig/server/lib/classes/db_mysql.inc.php

    Code:
    105 105	public function query($queryString) {
        106		parent::ping();
    106 107 	$this->queryId = parent::query($queryString);
    
    ping check for connection and if lost and mysqli.reconnect is enabled them reconnect it.

    So enable reconnect in /etc/php5/cli/php.ini

    Code:
    mysqli.reconnect = On
    
    Here is question if is not better to have custom php.ini for ispconfig cronjobs, which will have preddefined values, because backup files have UTC time by default. I have to set timezone also.

    It's working now :)

    I also edit cron job, I change nice and ionice, because backuping is intensive task

    Code:
    30 00 * * * /usr/bin/nice -n19 /usr/bin/ionice -c3 /usr/local/ispconfig/server/cron_daily.sh > /dev/null 2>> /var/log/ispconfig/cron.log
    
    I don't know, what is better:

    Calling ping direct in query function, or call it in long time scripts before every query?
    Changing nice and ionice for whole cron_daily.sh or only in backup section when calling zip/tar/gzip commands?
     
    Last edited: Nov 8, 2012
  7. falko

    falko Super Moderator Howtoforge Staff

    Thanks a lot! I've added this to our bugtracker. :)
     
  8. abdi

    abdi Member

    Falko: do we have yet a feature in the upcoming version of API to initiate backup download. IE, in the control panel when you click download backup file, it's then pushed to the backup folder in the root of a domain name.

    Thanks
     

Share This Page