0017692: "temporing up" in output of "processmaker workspace-backup" is not English (or any other language) SOLVED
al ejecutar el comando de backup daba un mensaje con una palabra que no existe en ingles se soluciono sacando esa palabra y colocando otra que se acomoda mejor
This commit is contained in:
@@ -14,14 +14,14 @@ class multipleFilesBackup
|
|||||||
private $dir_to_compress = "";
|
private $dir_to_compress = "";
|
||||||
private $filename = "backUpProcessMaker.tar";
|
private $filename = "backUpProcessMaker.tar";
|
||||||
private $fileSize = "1000";
|
private $fileSize = "1000";
|
||||||
// 1 GB by default.
|
// 1 GB by default.
|
||||||
private $sizeDescriptor = "m";
|
private $sizeDescriptor = "m";
|
||||||
//megabytes
|
//megabytes
|
||||||
private $tempDirectories = array ();
|
private $tempDirectories = array ();
|
||||||
|
|
||||||
/* Constructor
|
/* Constructor
|
||||||
* @filename contains the path and filename of the comppress file(s).
|
* @filename contains the path and filename of the comppress file(s).
|
||||||
* @size got the Max size of the compressed files, by default if the $size less to zero will mantains 1000 Mb as Max size.
|
* @size got the Max size of the compressed files, by default if the $size less to zero will mantains 1000 Mb as Max size.
|
||||||
*/
|
*/
|
||||||
public function multipleFilesBackup ($filename, $size)
|
public function multipleFilesBackup ($filename, $size)
|
||||||
{
|
{
|
||||||
@@ -33,24 +33,24 @@ class multipleFilesBackup
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Gets workspace information enough to make its backup.
|
/* Gets workspace information enough to make its backup.
|
||||||
* @workspace contains the workspace to be add to the commpression process.
|
* @workspace contains the workspace to be add to the commpression process.
|
||||||
*/
|
*/
|
||||||
public function addToBackup ($workspace)
|
public function addToBackup ($workspace)
|
||||||
{
|
{
|
||||||
//verifing if workspace exists.
|
//verifing if workspace exists.
|
||||||
if (! $workspace->workspaceExists()) {
|
if (! $workspace->workspaceExists()) {
|
||||||
echo "Workspace {$workspace->name} not found\n";
|
echo "Workspace {$workspace->name} not found\n";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//create destination path
|
//create destination path
|
||||||
if (! file_exists( PATH_DATA . "upgrade/" )) {
|
if (! file_exists( PATH_DATA . "upgrade/" )) {
|
||||||
mkdir( PATH_DATA . "upgrade/" );
|
mkdir( PATH_DATA . "upgrade/" );
|
||||||
}
|
}
|
||||||
$tempDirectory = PATH_DATA . "upgrade/" . basename( tempnam( __FILE__, '' ) );
|
$tempDirectory = PATH_DATA . "upgrade/" . basename( tempnam( __FILE__, '' ) );
|
||||||
mkdir( $tempDirectory );
|
mkdir( $tempDirectory );
|
||||||
$metadata = $workspace->getMetadata();
|
$metadata = $workspace->getMetadata();
|
||||||
CLI::logging( "Temporing up database...\n" );
|
CLI::logging( "Creating temporary files on database...\n" );
|
||||||
$metadata["databases"] = $workspace->exportDatabase( $tempDirectory );
|
$metadata["databases"] = $workspace->exportDatabase( $tempDirectory );
|
||||||
$metadata["directories"] = array ("{$workspace->name}.files");
|
$metadata["directories"] = array ("{$workspace->name}.files");
|
||||||
$metadata["version"] = 1;
|
$metadata["version"] = 1;
|
||||||
@@ -65,8 +65,8 @@ class multipleFilesBackup
|
|||||||
$this->tempDirectories[] = $tempDirectory;
|
$this->tempDirectories[] = $tempDirectory;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Add a directory containing Db files or info files to be commpressed
|
/* Add a directory containing Db files or info files to be commpressed
|
||||||
* @directory the name and path of the directory to be add to the commpression process.
|
* @directory the name and path of the directory to be add to the commpression process.
|
||||||
*/
|
*/
|
||||||
private function addDirToBackup ($directory)
|
private function addDirToBackup ($directory)
|
||||||
{
|
{
|
||||||
@@ -75,37 +75,37 @@ class multipleFilesBackup
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Commpress the DB and files into a single or several files with numerical series extentions
|
// Commpress the DB and files into a single or several files with numerical series extentions
|
||||||
|
|
||||||
public function letsBackup ()
|
public function letsBackup ()
|
||||||
{
|
{
|
||||||
// creating command
|
// creating command
|
||||||
$CommpressCommand = "tar czv ";
|
$CommpressCommand = "tar czv ";
|
||||||
$CommpressCommand .= $this->dir_to_compress;
|
$CommpressCommand .= $this->dir_to_compress;
|
||||||
$CommpressCommand .= "| split -b ";
|
$CommpressCommand .= "| split -b ";
|
||||||
$CommpressCommand .= $this->fileSize;
|
$CommpressCommand .= $this->fileSize;
|
||||||
$CommpressCommand .= "m -d - ";
|
$CommpressCommand .= "m -d - ";
|
||||||
$CommpressCommand .= $this->filename . ".";
|
$CommpressCommand .= $this->filename . ".";
|
||||||
//executing command to create the files
|
//executing command to create the files
|
||||||
echo exec( $CommpressCommand );
|
echo exec( $CommpressCommand );
|
||||||
//Remove leftovers dirs.
|
//Remove leftovers dirs.
|
||||||
foreach ($this->tempDirectories as $tempDirectory) {
|
foreach ($this->tempDirectories as $tempDirectory) {
|
||||||
CLI::logging( "Deleting: " . $tempDirectory . "\n" );
|
CLI::logging( "Deleting: " . $tempDirectory . "\n" );
|
||||||
G::rm_dir( $tempDirectory );
|
G::rm_dir( $tempDirectory );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Restore from file(s) commpressed by letsBackup function, into a temporary directory
|
/* Restore from file(s) commpressed by letsBackup function, into a temporary directory
|
||||||
* @ filename got the name and path of the compressed file(s), if there are many files with file extention as a numerical series, the extention should be discriminated.
|
* @ filename got the name and path of the compressed file(s), if there are many files with file extention as a numerical series, the extention should be discriminated.
|
||||||
* @ srcWorkspace contains the workspace to be restored.
|
* @ srcWorkspace contains the workspace to be restored.
|
||||||
* @ dstWorkspace contains the workspace to be overwriting.
|
* @ dstWorkspace contains the workspace to be overwriting.
|
||||||
* @ overwrite got the option true if the workspace will be overwrite.
|
* @ overwrite got the option true if the workspace will be overwrite.
|
||||||
*/
|
*/
|
||||||
static public function letsRestore ($filename, $srcWorkspace, $dstWorkspace = null, $overwrite = true)
|
static public function letsRestore ($filename, $srcWorkspace, $dstWorkspace = null, $overwrite = true)
|
||||||
{
|
{
|
||||||
// Needed info:
|
// Needed info:
|
||||||
// TEMPDIR /shared/workflow_data/upgrade/
|
// TEMPDIR /shared/workflow_data/upgrade/
|
||||||
// BACKUPS /shared/workflow_data/backups/
|
// BACKUPS /shared/workflow_data/backups/
|
||||||
// Creating command cat myfiles_split.tgz_* | tar xz
|
// Creating command cat myfiles_split.tgz_* | tar xz
|
||||||
$DecommpressCommand = "cat " . $filename . ".* ";
|
$DecommpressCommand = "cat " . $filename . ".* ";
|
||||||
$DecommpressCommand .= " | tar xzv";
|
$DecommpressCommand .= " | tar xzv";
|
||||||
|
|
||||||
@@ -116,13 +116,13 @@ class multipleFilesBackup
|
|||||||
} else {
|
} else {
|
||||||
throw new Exception( "Could not create directory:" . $parentDirectory );
|
throw new Exception( "Could not create directory:" . $parentDirectory );
|
||||||
}
|
}
|
||||||
//Extract all backup files, including database scripts and workspace files
|
//Extract all backup files, including database scripts and workspace files
|
||||||
CLI::logging( "Restoring into " . $tempDirectory . "\n" );
|
CLI::logging( "Restoring into " . $tempDirectory . "\n" );
|
||||||
chdir( $tempDirectory );
|
chdir( $tempDirectory );
|
||||||
echo exec( $DecommpressCommand );
|
echo exec( $DecommpressCommand );
|
||||||
CLI::logging( "\nUncompressed into: " . $tempDirectory . "\n" );
|
CLI::logging( "\nUncompressed into: " . $tempDirectory . "\n" );
|
||||||
|
|
||||||
//Search for metafiles in the new standard (the old standard would contain meta files.
|
//Search for metafiles in the new standard (the old standard would contain meta files.
|
||||||
$metaFiles = glob( $tempDirectory . "/*.meta" );
|
$metaFiles = glob( $tempDirectory . "/*.meta" );
|
||||||
if (empty( $metaFiles )) {
|
if (empty( $metaFiles )) {
|
||||||
$metaFiles = glob( $tempDirectory . "/*.txt" );
|
$metaFiles = glob( $tempDirectory . "/*.txt" );
|
||||||
|
|||||||
Reference in New Issue
Block a user