Jump to content

a simple script for backups?


Im Jake

Recommended Posts

Heres a simple way to do it.

 

mysqldump -ce --user=username --password=password dbname | gzip | uuencode dbbackup_e.gz | mail [email protected]

 

Chaneg the dbbackup_e.giz to a time(); format, use mkdir and name it the time(); format, and move the renamed file to your backup folder.

 

or like this

 

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

<?
$dbhost = "localhost";
$dbuser = "runefant";
$dbpass = "pass here";
$dbname = "runefant_rf";
$backupfile = "backup";

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

 

thats my total code and its not making a backup :(

Was just working with him..

 

Here's the file:

 

<?

$dbhost = "localhost";

$dbuser = "runefant";

$dbpass = "";

$dbname = "runefant_rf";

$backupFile = $dbname . date("Y-m-d-H-i-s") . '.gz';

$command = "mysqldump --opt -h $dbhost -u $dbuser -p $dbpass $dbname | gzip > $backupFile";

system($command);

echo "Success!!!";

?>

 

He's getting the echo Success!!! but the file is not being made.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.