2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-01-31 12:49:34 +00:00

changed archivname for backups.

git-svn-id: https://svn.fhem.de/fhem/trunk@1581 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
mfr69bs 2012-05-24 09:17:03 +00:00
parent 8db37eb849
commit c0e8dd7c03

View File

@ -441,15 +441,16 @@ CreateBackup($)
$backuppaths .= " $conf";
my $dateTime = TimeNow();
$dateTime =~ s/ /_/g;
$dateTime =~ s/(:|-)//g;
# prevents tar's output of "Removing leading /" and return total bytes of archive
$ret = `(mkdir -p $backupdir && tar -C $modpath -cf - $backuppaths | gzip > $backupdir/FHEM.$dateTime.tar.gz) 2>&1`;
$ret = `(mkdir -p $backupdir && tar -C $modpath -cf - $backuppaths | gzip > $backupdir/FHEM-$dateTime.tar.gz) 2>&1`;
unlink("$modpath/$conf");
if($ret) {
chomp $ret;
return $ret;
}
my $size = -s "$backupdir/FHEM.$dateTime.tar.gz";
return "backup done: FHEM.$dateTime.tar.gz ($size Bytes)";
my $size = -s "$backupdir/FHEM-$dateTime.tar.gz";
return "backup done: FHEM-$dateTime.tar.gz ($size Bytes)";
}
sub