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 $filename = "backUpProcessMaker.tar";
|
||||
private $fileSize = "1000";
|
||||
// 1 GB by default.
|
||||
// 1 GB by default.
|
||||
private $sizeDescriptor = "m";
|
||||
//megabytes
|
||||
//megabytes
|
||||
private $tempDirectories = array ();
|
||||
|
||||
/* Constructor
|
||||
* @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.
|
||||
/* Constructor
|
||||
* @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.
|
||||
*/
|
||||
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.
|
||||
*/
|
||||
public function addToBackup ($workspace)
|
||||
{
|
||||
//verifing if workspace exists.
|
||||
//verifing if workspace exists.
|
||||
if (! $workspace->workspaceExists()) {
|
||||
echo "Workspace {$workspace->name} not found\n";
|
||||
return false;
|
||||
}
|
||||
//create destination path
|
||||
//create destination path
|
||||
if (! file_exists( PATH_DATA . "upgrade/" )) {
|
||||
mkdir( PATH_DATA . "upgrade/" );
|
||||
}
|
||||
$tempDirectory = PATH_DATA . "upgrade/" . basename( tempnam( __FILE__, '' ) );
|
||||
mkdir( $tempDirectory );
|
||||
$metadata = $workspace->getMetadata();
|
||||
CLI::logging( "Temporing up database...\n" );
|
||||
CLI::logging( "Creating temporary files on database...\n" );
|
||||
$metadata["databases"] = $workspace->exportDatabase( $tempDirectory );
|
||||
$metadata["directories"] = array ("{$workspace->name}.files");
|
||||
$metadata["version"] = 1;
|
||||
@@ -65,8 +65,8 @@ class multipleFilesBackup
|
||||
$this->tempDirectories[] = $tempDirectory;
|
||||
}
|
||||
|
||||
/* 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.
|
||||
/* 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.
|
||||
*/
|
||||
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 ()
|
||||
{
|
||||
// creating command
|
||||
// creating command
|
||||
$CommpressCommand = "tar czv ";
|
||||
$CommpressCommand .= $this->dir_to_compress;
|
||||
$CommpressCommand .= "| split -b ";
|
||||
$CommpressCommand .= $this->fileSize;
|
||||
$CommpressCommand .= "m -d - ";
|
||||
$CommpressCommand .= $this->filename . ".";
|
||||
//executing command to create the files
|
||||
//executing command to create the files
|
||||
echo exec( $CommpressCommand );
|
||||
//Remove leftovers dirs.
|
||||
//Remove leftovers dirs.
|
||||
foreach ($this->tempDirectories as $tempDirectory) {
|
||||
CLI::logging( "Deleting: " . $tempDirectory . "\n" );
|
||||
G::rm_dir( $tempDirectory );
|
||||
}
|
||||
}
|
||||
/* 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.
|
||||
* @ srcWorkspace contains the workspace to be restored.
|
||||
* @ dstWorkspace contains the workspace to be overwriting.
|
||||
* @ overwrite got the option true if the workspace will be overwrite.
|
||||
/* 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.
|
||||
* @ srcWorkspace contains the workspace to be restored.
|
||||
* @ dstWorkspace contains the workspace to be overwriting.
|
||||
* @ overwrite got the option true if the workspace will be overwrite.
|
||||
*/
|
||||
static public function letsRestore ($filename, $srcWorkspace, $dstWorkspace = null, $overwrite = true)
|
||||
{
|
||||
// Needed info:
|
||||
// TEMPDIR /shared/workflow_data/upgrade/
|
||||
// BACKUPS /shared/workflow_data/backups/
|
||||
// Creating command cat myfiles_split.tgz_* | tar xz
|
||||
// Needed info:
|
||||
// TEMPDIR /shared/workflow_data/upgrade/
|
||||
// BACKUPS /shared/workflow_data/backups/
|
||||
// Creating command cat myfiles_split.tgz_* | tar xz
|
||||
$DecommpressCommand = "cat " . $filename . ".* ";
|
||||
$DecommpressCommand .= " | tar xzv";
|
||||
|
||||
@@ -116,13 +116,13 @@ class multipleFilesBackup
|
||||
} else {
|
||||
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" );
|
||||
chdir( $tempDirectory );
|
||||
echo exec( $DecommpressCommand );
|
||||
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" );
|
||||
if (empty( $metaFiles )) {
|
||||
$metaFiles = glob( $tempDirectory . "/*.txt" );
|
||||
|
||||
Reference in New Issue
Block a user