2
Contributors
3
Replies
4
Views
9 Years
Discussion Span
Last Post by carobee
0

Like this:

$script = "tar -czf $backupdir/DATABASE-$dbname.tgz $backupdir/$dbname.sql";
 $results = system($script,$retval);
 echo "\n CREATE TAR FILE:\n $results\n RETURN VALUE: $retval\n";

Obviously fill in the $variables as needed.

but I use it for a backup of mysql db;s

0

Like this:

$script = "tar -czf $backupdir/DATABASE-$dbname.tgz $backupdir/$dbname.sql";
 $results = system($script,$retval);
 echo "\n CREATE TAR FILE:\n $results\n RETURN VALUE: $retval\n";

Obviously fill in the $variables as needed.

but I use it for a backup of mysql db;s

your file was .tgz extension. for me it is tar.gz. and i think you are compressing it, wh abt extracting the files. i have been trying with syntax like this
$output=shell_exec("cd /dir ; gunzip {$path}; ");
$path is the variable used in uploading the file
what after that?

0

here is the solution. If you don't know the filename nad it is stored in some php variable
let $filename=x.tar.gz

shell_exec("cd destination_directory; gunzip {$filename}| tar xf -;");
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.