Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 2 3 [4]

Author Topic: [MOD] Simple MySQL Backup v0.1 (no system calls)  (Read 20227 times)

Joost

  • Guest
Re: [MOD] Simple MySQL Backup v0.1 (no system calls)
« Reply #45 on: February 17, 2010, 04:15:06 PM »

I have little time to or explain and no time to write code, so in short:
The script you're using uses to much memory (as said) to process a file (dump) that is probably a lot smaller.
You can however, use an external program: mysqldump.
Here is an example taken from PHP MySQL Tutorial. Mysql is started by the php command system, which is unfortunately, not enabled on every server.

<?php
include 'config.php';
include 'opendb.php';

$backupFile = $dbname . date("Y-m-d-H-i-s") . '.gz';
$command = "mysqldump --opt -h $dbhost -u $dbuser -p $dbpass $dbname | gzip > $backupFile";
system($command);
include 'closedb.php';
?>
Logged

Sven

  • ULTIMATE member
  • ******
  • Karma: 88
  • Posts: 2029
  • Chasing MY bugs!
    • hiseo.fr - rédacteur Web
Re: [MOD] Simple MySQL Backup v0.1 (no system calls)
« Reply #46 on: February 17, 2010, 05:09:39 PM »

Okey okey...
I'm gonna try it.
Merci beaucoup Joostey.

Sven

  • ULTIMATE member
  • ******
  • Karma: 88
  • Posts: 2029
  • Chasing MY bugs!
    • hiseo.fr - rédacteur Web
Re: [MOD] Simple MySQL Backup v0.1 (no system calls)
« Reply #47 on: February 18, 2010, 07:55:05 AM »

And the winner is... Joostey!
Made it "fingers in the nose". ;D

Joost

  • Guest
Re: [MOD] Simple MySQL Backup v0.1 (no system calls)
« Reply #48 on: February 18, 2010, 05:37:09 PM »

Inspecteur, vous êtes le champion. You have created a mod all by yourself. Karma.
Logged

Sven

  • ULTIMATE member
  • ******
  • Karma: 88
  • Posts: 2029
  • Chasing MY bugs!
    • hiseo.fr - rédacteur Web
Re: [MOD] Simple MySQL Backup v0.1 (no system calls)
« Reply #49 on: February 19, 2010, 11:20:23 AM »

Inspecteur, vous êtes le champion. You have created a mod all by yourself. Karma.
Yeap. And for myself only.
And as you've scratched my back with a karma, I've scratched yours too.

Pein

  • Newbie
  • *
  • Karma: 0
  • Posts: 28
  • n0 n33d t0 b3 l33t
Re: [MOD] Simple MySQL Backup v0.1 (no system calls)
« Reply #50 on: August 23, 2010, 04:05:40 PM »

Howdy,

can someone more userfriendly show where must go the new code?! Cuz Im not getting it to work all errors! Please!

Greetings,
David

Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: [MOD] Simple MySQL Backup v0.1 (no system calls)
« Reply #51 on: August 23, 2010, 04:16:27 PM »

Howdy, can someone more userfriendly show where must go the new code?! Cuz Im not getting it to work all errors! Please!
Greetings, David

Hi David:
Question: Are you installing it with an sNews 1.6 or sNews 1.7 package?
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU

Pein

  • Newbie
  • *
  • Karma: 0
  • Posts: 28
  • n0 n33d t0 b3 l33t
Re: [MOD] Simple MySQL Backup v0.1 (no system calls)
« Reply #52 on: August 23, 2010, 04:51:53 PM »

Howdy, can someone more userfriendly show where must go the new code?! Cuz Im not getting it to work all errors! Please!
Greetings, David

Hi David:
Question: Are you installing it with an sNews 1.6 or sNews 1.7 package?

Howdy Key,

im trying it to install with 1.7. I hope this one doesnt uses exec.
Logged

Keyrocks

  • Doug
  • ULTIMATE member
  • ******
  • Karma: 449
  • Posts: 6019
  • Semantically Challenged
    • snews.ca
Re: [MOD] Simple MySQL Backup v0.1 (no system calls)
« Reply #53 on: August 23, 2010, 05:01:17 PM »

Howdy Key, im trying it to install with 1.7. I hope this one doesnt uses exec.

Updated: Here is the sNews 1.7 Version.
« Last Edit: August 23, 2010, 06:49:35 PM by Keyrocks »
Logged
Do it now... later may not come.
-------------------------------------------------------------------------------------------------
sNews 1.6 MESU | sNews 1.6 MEMU
Pages: 1 2 3 [4]