* Tue Feb 25 2025 Brian Read <brianr@koozali.org> 11.0.0-58.sme
- re-organise open db placement [SME: 12695] - Re-arrange parameters to tar to avoid warning message in logs [SME: 12943]
This commit is contained in:
parent
ce96f72726
commit
1c93be6e8a
@ -135,7 +135,11 @@ sub do_display {
|
|||||||
$c->stash(compressionlevel => $CompressionLevel, exclude => \@exclude, directories => \@directories);
|
$c->stash(compressionlevel => $CompressionLevel, exclude => \@exclude, directories => \@directories);
|
||||||
|
|
||||||
# streaming download in template
|
# streaming download in template
|
||||||
return $c->render("/backdown");
|
$c->render(template=>"backdown");
|
||||||
|
#sleep(30);
|
||||||
|
# Redirect to the front page
|
||||||
|
#$c->redirect_to('/backup');
|
||||||
|
return ""
|
||||||
} ## end if ($function eq 'desktop_backup')
|
} ## end if ($function eq 'desktop_backup')
|
||||||
|
|
||||||
if ($function eq 'tape_configure') {
|
if ($function eq 'tape_configure') {
|
||||||
@ -2020,4 +2024,4 @@ sub vmount {
|
|||||||
return (qx(/bin/mount -t nfs -o nolock,timeo=30,retrans=1,retry=0 "$host:/$share" $mountdir 2>&1));
|
return (qx(/bin/mount -t nfs -o nolock,timeo=30,retrans=1,retry=0 "$host:/$share" $mountdir 2>&1));
|
||||||
}
|
}
|
||||||
} ## end sub vmount
|
} ## end sub vmount
|
||||||
1;
|
1;
|
@ -19,29 +19,38 @@
|
|||||||
my $cmd = "/bin/tar --create --file=- --directory / @{$c->stash('exclude')} "
|
my $cmd = "/bin/tar --create --file=- --directory / @{$c->stash('exclude')} "
|
||||||
. "@{$c->stash('directories')} | /usr/bin/gzip $clvl ";
|
. "@{$c->stash('directories')} | /usr/bin/gzip $clvl ";
|
||||||
|
|
||||||
#die("$cmd");
|
|
||||||
|
|
||||||
my $success = open my $fh, '-|', $cmd;
|
my $success = open my $fh, '-|', $cmd;
|
||||||
unless ($success) { return "Error dowload command."; };
|
#unless ($success) { return "Error download command."; };
|
||||||
|
if ($success) {
|
||||||
# Write chunk
|
# Try with download plugin - seems to fail to complete download and also
|
||||||
$c->res->headers->content_type('application/x-tar');
|
# name of file deposited is not as required.
|
||||||
$c->res->headers->content_disposition(qq/attachment; filename="smeserver.tgz"/);
|
#my $output = do { local $/; <$fh> };
|
||||||
|
#close $fh;
|
||||||
my $cb;
|
#$c->render_file(
|
||||||
$cb = sub {
|
#data => $output,
|
||||||
my $c = shift;
|
#filename => 'output.txt',
|
||||||
my $size = 500 * 1024;
|
#content_type => 'text/plain'
|
||||||
my $length = sysread($fh, my $buffer, $size);
|
#);
|
||||||
unless ($length) {
|
# So organise it ourselves.
|
||||||
close $fh;
|
$c->res->headers->content_type('application/x-tar');
|
||||||
undef $cb;
|
$c->res->headers->content_disposition(qq/attachment; filename="smeserver.tgz"/);
|
||||||
$c->finish;
|
my $cb;
|
||||||
return;
|
$cb = sub {
|
||||||
}
|
my $c = shift;
|
||||||
$c->write_chunk($buffer, $cb);
|
my $size = 500 * 1024;
|
||||||
};
|
my $length = sysread($fh, my $buffer, $size);
|
||||||
$c->$cb;
|
unless ($length) {
|
||||||
|
close $fh;
|
||||||
|
undef $cb;
|
||||||
|
$c->finish;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$c->write_chunk($buffer, $cb);
|
||||||
|
};
|
||||||
|
$c->$cb;
|
||||||
|
} else {
|
||||||
|
$c->render(text => "Failed to execute command: $!", status => 500);
|
||||||
|
}
|
||||||
|
|
||||||
# Remove the dumped tables.
|
# Remove the dumped tables.
|
||||||
$status = system("/sbin/e-smith/signal-event", "post-backup", "desktop");
|
$status = system("/sbin/e-smith/signal-event", "post-backup", "desktop");
|
||||||
@ -54,4 +63,5 @@
|
|||||||
$backup_rec->set_prop('EndEpochTime', "$now");
|
$backup_rec->set_prop('EndEpochTime', "$now");
|
||||||
$backup_rec->set_prop('Result', "0");
|
$backup_rec->set_prop('Result', "0");
|
||||||
|
|
||||||
%>
|
%>
|
||||||
|
1;
|
@ -2,7 +2,7 @@ Summary: Sme server navigation module : manager 2
|
|||||||
%define name smeserver-manager
|
%define name smeserver-manager
|
||||||
Name: %{name}
|
Name: %{name}
|
||||||
%define version 11.0.0
|
%define version 11.0.0
|
||||||
%define release 57
|
%define release 58
|
||||||
Version: %{version}
|
Version: %{version}
|
||||||
Release: %{release}%{?dist}
|
Release: %{release}%{?dist}
|
||||||
License: GPL
|
License: GPL
|
||||||
@ -143,6 +143,10 @@ true
|
|||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Tue Feb 25 2025 Brian Read <brianr@koozali.org> 11.0.0-58.sme
|
||||||
|
- re-organise open db placement [SME: 12695]
|
||||||
|
- Re-arrange parameters to tar to avoid warning message in logs [SME: 12943]
|
||||||
|
|
||||||
* Fri Feb 21 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-57.sme
|
* Fri Feb 21 2025 Jean-Philippe Pialasse <jpp@koozali.org> 11.0.0-57.sme
|
||||||
- upgrade validate_password sub to use esmith::util [SME: 12937]
|
- upgrade validate_password sub to use esmith::util [SME: 12937]
|
||||||
and deduplicate code
|
and deduplicate code
|
||||||
|
Loading…
x
Reference in New Issue
Block a user