From 52448e6b0a8d35c3356b0024fbd0f239915ef835 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 17 Apr 2015 09:50:49 +0200 Subject: [PATCH] Bug 13876: Add the from => to versions in the filenames Additionally to the datetime, it could be useful to have the version numbers in the log filenames. Signed-off-by: Jonathan Druart Signed-off-by: Marcel de Rooy Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- installer/install.pl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/installer/install.pl b/installer/install.pl index e43caa0f01..1fbc685843 100755 --- a/installer/install.pl +++ b/installer/install.pl @@ -322,7 +322,12 @@ elsif ( $step && $step == 3 ) { my $now = POSIX::strftime( "%Y-%m-%dT%H:%M:%S", localtime() ); my $logdir = C4::Context->config('logdir'); - my ( $logfilepath, $logfilepath_errors ) = ( chk_log($logdir, "updatedatabase_$now"), chk_log($logdir, "updatedatabase-error_$now") ); + my $dbversion = C4::Context->preference('Version'); + my $kohaversion = C4::Context->KOHAVERSION; + $kohaversion =~ s/(.*\..*)\.(.*)\.(.*)/$1$2$3/; + + my $filename_suffix = join '_', $now, $dbversion, $kohaversion; + my ( $logfilepath, $logfilepath_errors ) = ( chk_log($logdir, "updatedatabase_$filename_suffix"), chk_log($logdir, "updatedatabase-error_$filename_suffix") ); my $cmd = C4::Context->config("intranetdir") . "/installer/data/$info{dbms}/updatedatabase.pl >> $logfilepath 2>> $logfilepath_errors"; -- 2.39.5