2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 06:39:11 +00:00

93_DbRep: dumpMySQL clientSide: change dump file to stricter rights

git-svn-id: https://svn.fhem.de/fhem/trunk@28129 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
nasseeder1 2023-11-05 20:10:34 +00:00
parent 6a1c1865a2
commit c72a93cdfa
2 changed files with 39 additions and 13 deletions

View File

@ -1,5 +1,6 @@
# Add changes at the top of the list. Keep it in ASCII, and 80-char wide.
# Do not insert empty lines here, update check depends on it.
- change: 93_DbRep: dumpMySQL clientSide: change dump file to stricter rights
- bugfix: 47_OBIS: Implement "nohacks" attribute
- bugfix: 36_Shelly: undefinded values on restart
- bugfix: 36_Shelly: Refresh: removed fixed name of FHEMWEB device

View File

@ -59,6 +59,7 @@ no if $] >= 5.017011, warnings => 'experimental::smartmatch';
# Version History intern
my %DbRep_vNotesIntern = (
"8.52.12" => "05.11.2023 dumpMySQL clientSide: change the dump file to stricter rights ",
"8.52.11" => "17.09.2023 improve the markout in func DbRep_checkValidTimeSequence, Forum:#134973 ",
"8.52.10" => "09.07.2023 fix wrong SQL syntax for PostgreSQL -> DbRep_createSelectSql, Forum:#134170 ",
"8.52.9" => "05.07.2023 fix wrong SQL syntax for PostgreSQL -> maxValue deleteOther, Forum:#134170 ",
@ -8431,7 +8432,7 @@ sub DbRep_mysql_DumpClientSide {
my $dump_table = 1;
if ($dbpraefix ne "") {
if (substr($tablename,0,length($dbpraefix)) ne $dbpraefix) { # exclude table from backup because it doesn't fit to praefix
if (substr ($tablename, 0, length($dbpraefix)) ne $dbpraefix) { # exclude table from backup because it doesn't fit to praefix
$dump_table = 0;
}
}
@ -8480,14 +8481,20 @@ sub DbRep_mysql_DumpClientSide {
$sql_text = $status_start.$status_end;
# neues SQL-Ausgabefile anlegen
($err, $sql_text, $first_insert, $sql_file, $backupfile) = DbRep_NewDumpFilename($sql_text, $dump_path, $dbname, $time_stamp, $character_set);
($err, $sql_text, $first_insert, $sql_file, $backupfile) = DbRep_NewDumpFilename ( { sql_text => $sql_text,
dump_path => $dump_path,
dbname => $dbname,
time_stamp => $time_stamp,
character_set => $character_set
}
);
if ($err) {
Log3 ($name, 2, "DbRep $name - $err");
$err = encode_base64($err,"");
$err = encode_base64 ($err, "");
return "$name|$err";
}
else {
Log3 ($name, 5, "DbRep $name - New dumpfile $sql_file has been created.");
Log3 ($name, 5, "DbRep $name - New dump file $sql_file was created");
}
##################### jede einzelne Tabelle dumpen ########################
@ -12679,7 +12686,13 @@ return;
# erstellen neues SQL-File für Dumproutine
####################################################################################################
sub DbRep_NewDumpFilename {
my ($sql_text,$dump_path,$dbname,$time_stamp,$character_set) = @_;
my $paref = shift;
my $sql_text = $paref->{sql_text};
my $dump_path = $paref->{dump_path};
my $dbname = $paref->{dbname};
my $time_stamp = $paref->{time_stamp};
my $character_set = $paref->{character_set};
my $part = "";
my $sql_file = $dump_path.$dbname."_".$time_stamp.$part.".sql";
my $backupfile = $dbname."_".$time_stamp.$part.".sql";
@ -12690,7 +12703,7 @@ sub DbRep_NewDumpFilename {
my ($err, $filesize) = DbRep_WriteToDumpFile($sql_text, $sql_file);
return $err if($err);
chmod(0777, $sql_file);
chmod (0664, $sql_file);
$sql_text = "";
my $first_insert = 0;
@ -16542,11 +16555,16 @@ sub dbval {
</li>
<a id="DbRep-attr-dumpComment"></a>
<li><b>dumpComment </b> - User-comment. It will be included in the header of the created dumpfile by
command "dumpMySQL clientSide". </li> <br>
<li><b>dumpComment </b> <br>
User-specific comment which is entered in the header of the file generated by "dumpMyQL clientSide".
</li>
<br>
<a id="DbRep-attr-dumpCompress"></a>
<li><b>dumpCompress </b> - if set, the dump files are compressed after operation of "dumpMySQL" bzw. "dumpSQLite" </li> <br>
<li><b>dumpCompress </b> <br>
If set, the file created by "dumpMySQL" or "dumpSQLite" is then compressed and the uncompressed source file is deleted.
</li>
<br>
<a id="DbRep-attr-dumpDirLocal"></a>
<li><b>dumpDirLocal </b> <br><br>
@ -19583,11 +19601,18 @@ sub dbval {
</li>
<a id="DbRep-attr-dumpComment"></a>
<li><b>dumpComment </b> - User-Kommentar. Er wird im Kopf des durch den Befehl "dumpMyQL clientSide" erzeugten Dumpfiles
eingetragen. </li> <br>
<li><b>dumpComment </b> <br>
Benutzer spezifischer Kommentar, welcher im Kopf der durch "dumpMyQL clientSide" erzeugten Datei
eingetragen wird.
</li>
<br>
<a id="DbRep-attr-dumpCompress"></a>
<li><b>dumpCompress </b> - wenn gesetzt, werden die Dumpfiles nach "dumpMySQL" bzw. "dumpSQLite" komprimiert </li> <br>
<li><b>dumpCompress </b> <br>
Wenn gesetzt, wird die durch "dumpMySQL" bzw. "dumpSQLite" erzeugte Datei anschließend komprimiert und die
unkomprimierte Quellendatei gelöscht.
</li>
<br>
<a id="DbRep-attr-dumpDirLocal"></a>
<li><b>dumpDirLocal </b> <br><br>