pballz
New Member
- Messages
- 24
- Reaction score
- 0
- Points
- 1
I'm looking at methods to automate backing up a db. So instead of playing around and most likely getting frustrated when stuff doesn't work I'm gonna ask for advice first.
I found this as one method of backing up a db.
But I've read sometimes the mysqldump command is turned off so I was wondering if anyone could tell if this would work. Also any other methods of backing up a db would be greatly appreciated.
I found this as one method of backing up a db.
Code:
<?php
include 'config.php';
include 'opendb.php';
$backupFile = $dbname . [B]date("Y-m-d-H-i-s")[/B] . '.gz';
$command = "mysqldump --opt -h $dbhost -u $dbuser -p $dbpass $dbname | gzip > $backupFile";
[B]system($command);[/B]
include 'closedb.php';
?>