EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: Re: copying archived data from 32-bit to 64-bit machine
From: Bruce Hill <[email protected]>
To: Pierrick Hanlet <[email protected]>
Cc: Techtalk <[email protected]>, "Browne, Michael" <[email protected]>
Date: Mon, 28 Jan 2013 20:22:59 -0800
Hi Pierrick,
I'm attaching a patch from our 64 bit ChannelArchiver code.

I'm not sure it will help your problem, however, as a quick
scan of the diff's looked to me like all the changes were to
compile w/ Base 3.14.12, clean up warnings and improve
error handling.

We also have a different situation, in that we've been using a
64 bit machine for the archive engine from the start.

I'm not sure about the base code I'm comparing against.
I used the most original version I could find which appears to be
version 2.9.0, but may or may not have some changes made years ago
by other groups here at SLAC.

I've also downloaded some updates as of May 2012 from
http://epicschanarch.cvs.sourceforge.net/viewvc/epicschanarch/?view=tar
but haven't yet merged them into our code base.

We haven't changed update_indices.pl or IndexTool/main.cpp
as far as I know.   They still use the 32 bit index which hasn't
yet been an issue for us.   We have had some trouble with
corrupted files, particularly related to unexpected power outages,
but I think we also had some trouble when copying index
files to another machine.    You might try copying an index file
back to your 32 bit machine to see if it still works there.

Regards,
- Bruce Hill


On 01/26/2013 05:24 PM, Kasemir, Kay wrote:
Hi:

If you simply want to serve existing data, there should be no need to re-build any indices.
But the original software (ArchiveExport, ...) was not developed on 32 bit, so it might need some 32bit/64bit fixes.

I believe that there are people out there using the archive sources on 64 bit, but I don't know if they published their patches that were required to get everything working on 64 bit.
One issue could be that I think some people moved to 64 bit specifically to update the binary index and data file structure to support>2GB index files.
That would of course not be compatible with existing 32 bit data files.
So you'll have to look for somebody who got the old sources patched for 64 bit, but preserving the original, 32-bit data structures.

Thanks,
Kay

________________________________________
From: [email protected] [[email protected]] On Behalf Of Pierrick Hanlet [[email protected]]
Sent: Saturday, January 26, 2013 1:15 PM
To: James F Ross
Cc: Tech Talk
Subject: Re: copying archived data from 32-bit to 64-bit machine

Hi James,
Thanks for your response.  I'm using the old archiver and what I would like to do
is to use my new machine to serve the copied/archived data, so it does appear
that we have/had a similar problem.  I don't, at the moment, need the archive
engine.  I did successfully build the installation on the 64-bit machine.

If I'm not mistaken, ArchiveExport does not require the data server to be running,
but it does require that the index files be correct. If that is true, then I'm not even
at the point of concern for the server, but would like to rebuild the indices.  I've
tried update_indices.pl, but get errors with the archiveconfig.pm file
(not a HASH reference ...).  Am I correct in deducing that I need to recreate my
index files?  If so, any guidance on doing so would be welcome; I must be missing
something when I read the manual.
Thanks,
Pierrick


On 01/25/2013 06:35 PM, James F Ross wrote:
Is this the old channel archiver or the CSS based RDB archiver?

I did the same thing with the channel archiver and it took a while to resolve.  The heart of the trouble is that the cgi data server (ArchiveDataServer.cgi for the channel archiver) was unable to run due to a number of issues.  The archive viewer couldn't see the data because ArchiveDataServer.cgi couldn't start.  The final solution for me was to recompile the archiver from scratch on the 64 bit machine and use the xml index files and data from the 32 bit machine.  I had to have a lot of help doing this, so I won't be very helpful on how to do that I'm afraid.  However, my goal was to get the archiver running as well as being able to see the data.  Perhaps as long as you can get the archive data server working you don't need to do this.  I would suggest transferring ArchiveDataServer.cgi from the old machine to the new machine with all of its libraries (the 32 bit ones) as a starting point.

The channel archiver manual may help.  It has a section on testing this server.  It is woefully out of date and quite terse, but it can at least show you where to place the cgi server and how to test it:  http://www.slac.stanford.edu/grp/lcls/controls/global/sw/epics/extensions/ChannelArchiver/manual.pdf.

If you are using the RDB archiver, I'm afraid I can't help.

Hope that at least gives you a starting place!
James Ross


On Fri, Jan 25, 2013 at 5:19 PM, Pierrick Hanlet<[email protected]<mailto:[email protected]>>  wrote:
Hi,
I copied some archived data from a 32-bit machine to a 64-bit machine.  I'm not able
to read the data.  If I do an ArchiveExport I see only a very small number of entries.
I'm guessing that I need to regenerate the indices, but I've not been successful in doing
so; perhaps I'm not understanding the manual.

Please help.  I've wasted an inordinate amount of time.
Thanks,
Pierrick

--
"Whether you think you can or think you can't, either way, you are correct" -- Henry Ford
_______________________________________________________________
Pierrick Hanlet
IIT/Fermilab
+1-630-840-5555<tel:%2B1-630-840-5555>  (FNAL)
+1-312-567-5745<tel:%2B1-312-567-5745>  (IIT)
+1-630-697-8758<tel:%2B1-630-697-8758>/+44-79-48-860-197<tel:%2B44-79-48-860-197>  (US/UK mobile)


--
"Whether you think you can or think you can't, either way, you are correct" -- Henry Ford
_______________________________________________________________
Pierrick Hanlet
IIT/Fermilab
+1-630-840-5555 (FNAL)
+1-312-567-5745 (IIT)
+1-630-697-8758/+44-79-48-860-197 (US/UK mobile)


--
Bruce Hill
Member Technical Staff
SLAC National Accelerator Lab
2575 Sand Hill Road M/S 10
Menlo Park, CA  94025

Index: Export/main.cpp
===================================================================
--- Export/main.cpp	(revision 11617)
+++ Export/main.cpp	(working copy)
@@ -11,6 +11,7 @@
 // Storage
 #include <SpreadsheetReader.h>
 #include <AutoIndex.h>
+#include <stdexcept>
 
 #undef DEBUG_EXPORT
 
@@ -25,9 +26,10 @@
 {
     if (only_millisecs)
     {
-        epicsTimeStamp stamp = time;
-        stamp.nsec = ((stamp.nsec + 500000) / 1000000) * 1000000;
-        epicsTime2string(epicsTime(stamp), text);
+        epicsTimeStamp	stamp = time;
+        epicsTime		adjTime( time );
+		adjTime	-= stamp.nsec % 1000000;
+        epicsTime2string( adjTime, text);
         text = text.substr(0, 23);
         return;
     }
@@ -326,43 +328,66 @@
     {
         if (end && sheet.getTime() >= *end)
             break;
-        // '03/23/2004 10:48:48.032899334'
-        format_time(sheet.getTime(), time);
-        fprintf(f, "%s", time.c_str());
+		try
+		{
+			// '03/23/2004 10:48:48.032899334'
+			format_time(sheet.getTime(), time);
+		}
+		catch ( GenericException &e )
+		{
+			fprintf(stderr, "Error:\n%s\n", e.what());
+			epicsTime	eTime = epicsTime::getCurrent();
+			format_time( eTime, time );
+		}
+		catch ( std::logic_error &e )
+		{
+			fprintf(stderr, "Error:\n%s\n", e.what());
+			epicsTime	eTime = epicsTime::getCurrent();
+			format_time( eTime, time );
+		}
+		fprintf(f, "%s", time.c_str());
         if (raw_time)
         {
-            epicsTimeStamp stamp = sheet.getTime();
-            fprintf(f, "\t%lu", (unsigned long)stamp.secPastEpoch);
+			epicsTimeStamp stamp = sheet.getTime();
+			fprintf(f, "\t%lu", (unsigned long)stamp.secPastEpoch);
         }
-        for (i=0; i<sheet.getNum(); ++i)
-        {
-            value = sheet.get(i);
-            if (value)
-            {
-                RawValue::getStatus(value, stat);
-                if (RawValue::isInfo(value))
-                {
-                    fprintf(f, "\t#N/A");
-                    if (status_text)
-                        fprintf(f, "\t%s", stat.c_str());
-                }
-                else
-                {
-                    RawValue::getValueString(
-                        val, sheet.getType(i), sheet.getCount(i),
-                        value, &sheet.getInfo(i), format, precision);
-                    fprintf(f, "\t%s", val.c_str());
-                    if (status_text)
-                        fprintf(f, "\t%s", stat.c_str());
-                }
-            }
-            else
-            {
-                fprintf(f, "\t#N/A");
-                if (status_text)
-                    fprintf(f, "\t<no data>");
-            }
-        }
+		for (i=0; i<sheet.getNum(); ++i)
+		{
+			try
+			{
+				value = sheet.get(i);
+				if (value)
+				{
+					RawValue::getStatus(value, stat);
+					if (RawValue::isInfo(value))
+					{
+						fprintf(f, "\t#N/A");
+						if (status_text)
+							fprintf(f, "\t%s", stat.c_str());
+					}
+					else
+					{
+						RawValue::getValueString(
+							val, sheet.getType(i), sheet.getCount(i),
+							value, &sheet.getInfo(i), format, precision);
+						fprintf(f, "\t%s", val.c_str());
+						if (status_text)
+							fprintf(f, "\t%s", stat.c_str());
+					}
+				}
+				else
+				{
+					fprintf(f, "\t#N/A");
+					if (status_text)
+						fprintf(f, "\t<no data>");
+				}
+			}
+			catch (GenericException &e)
+			{
+				fprintf(stderr, "Error:\n%s\n", e.what());
+				fprintf(f, "\t?" );
+			}
+		}
         fprintf(f, "\n");
         ok = sheet.next();
     }
Index: XMLRPCServer/ArchiveDataServer.cpp
===================================================================
--- XMLRPCServer/ArchiveDataServer.cpp	(revision 11617)
+++ XMLRPCServer/ArchiveDataServer.cpp	(working copy)
@@ -551,8 +551,6 @@
 // { int32  ver, string desc } = archiver.info()
 xmlrpc_value *get_info(xmlrpc_env *env, xmlrpc_value *args, void *user)
 {
-    extern const char *alarmStatusString[];
-    extern const char *alarmSeverityString[];
 #ifdef LOGFILE
     LOG_MSG("archiver.info\n");
 #endif
@@ -586,7 +584,7 @@
         return 0;
     for (i=0; i<=lastEpicsAlarmCond; ++i)
     {
-        element = xmlrpc_build_value(env, "s", alarmStatusString[i]);
+        element = xmlrpc_build_value(env, "s", epicsAlarmConditionStrings[i]);
         xmlrpc_array_append_item(env, status, element);
         if (env->fault_occurred)
             return 0;
@@ -597,7 +595,7 @@
     {
         element = xmlrpc_build_value(env, "{s:i,s:s,s:b,s:b}",
                                      "num", (xmlrpc_int32)i,
-                                     "sevr", alarmSeverityString[i],
+                                     "sevr", epicsAlarmSeverityStrings[i],
                                      "has_value", (xmlrpc_bool) 1,
                                      "txt_stat", (xmlrpc_bool) 1);
         xmlrpc_array_append_item(env, severity, element);
Index: XMLRPCServer/xmlrpc-config-wrapper
===================================================================
--- XMLRPCServer/xmlrpc-config-wrapper	(revision 11617)
+++ XMLRPCServer/xmlrpc-config-wrapper	(working copy)
@@ -3,7 +3,7 @@
 v=`xmlrpc-c-config --version`
 
 case $v in
-  1.0*) client="client"
+  1.*) client="client"
         ;;
   0.*)  client="libwww-client"
         ;;
Index: LibIO/DataFile.h
===================================================================
--- LibIO/DataFile.h	(revision 11617)
+++ LibIO/DataFile.h	(working copy)
@@ -12,6 +12,9 @@
 #include "string2cp.h"
 #include "BinValue.h"
 
+// Forward declaration
+class DataHeaderIterator;
+
 //////////////////////////////////////////////////////////////////////
 // DataHeader
 //////////////////////////////////////////////////////////////////////
Index: LibIO/RawValue.cpp
===================================================================
--- LibIO/RawValue.cpp	(revision 11617)
+++ LibIO/RawValue.cpp	(working copy)
@@ -97,12 +97,12 @@
         return;
     }
 
-    if (severity < (short)SIZEOF_ARRAY(alarmSeverityString)  &&
-        (short)value->status < (short)SIZEOF_ARRAY(alarmStatusString))
+    if (severity < (short)SIZEOF_ARRAY(epicsAlarmSeverityStrings)  &&
+        (short)value->status < (short)SIZEOF_ARRAY(epicsAlarmConditionStrings))
     {
-        result = alarmSeverityString[severity];
+        result = epicsAlarmSeverityStrings[severity];
         result += " ";
-        result += alarmStatusString[value->status];
+        result += epicsAlarmConditionStrings[value->status];
     }
     else
     {
@@ -179,17 +179,17 @@
     }
 
     short i, j;
-    for (i=0; i<(short)SIZEOF_ARRAY(alarmSeverityString); ++i)
+    for (i=0; i<(short)SIZEOF_ARRAY(epicsAlarmSeverityStrings); ++i)
     {
-        if (!strncmp(text.c_str(), alarmSeverityString[i],
-                     strlen(alarmSeverityString[i])))
+        if (!strncmp(text.c_str(), epicsAlarmSeverityStrings[i],
+                     strlen(epicsAlarmSeverityStrings[i])))
         {
             sevr = i;
-            stdString status = text.substr(strlen(alarmSeverityString[i]));
+            stdString status = text.substr(strlen(epicsAlarmSeverityStrings[i]));
 
-            for (j=0; j<(short)SIZEOF_ARRAY(alarmStatusString); ++j)
+            for (j=0; j<(short)SIZEOF_ARRAY(epicsAlarmConditionStrings); ++j)
             {
-                if (status.find(alarmStatusString[j]) != stdString::npos)
+                if (status.find(epicsAlarmConditionStrings[j]) != stdString::npos)
                 {
                     stat = j;
                     return true;
Index: Tools/Guard.h
===================================================================
--- Tools/Guard.h	(revision 11617)
+++ Tools/Guard.h	(working copy)
@@ -49,6 +49,9 @@
 public:
     /** @return Returns the mutex for this object. */
     virtual OrderedMutex &getMutex() = 0;
+	virtual ~Guardable()
+	{
+	}
 };
 
 /** \ingroup Tools
Index: Storage/RawDataReader.cpp
===================================================================
--- Storage/RawDataReader.cpp	(revision 11617)
+++ Storage/RawDataReader.cpp	(working copy)
@@ -1,5 +1,12 @@
 // RawDataReader.cpp
 
+// Mods:
+//    07-Jul-2008 Bob Hall (rdh)
+//       Added line "DataFile::clear_cache();" at the suggestion of
+//       Kay Kasemir to fix retrieval problems when retrieving large
+//       amounts of data.  This change closes files that are no longer
+//       referenced so that one does not run out of file descriptors.
+
 // Tools
 #include "MsgLogger.h"
 #include "Filename.h"
@@ -228,6 +235,10 @@
                 datafile = DataFile::reference("", basename, false);
             else // Look relative to the index's directory
                 datafile = DataFile::reference(dirname, basename, false);
+
+            // If we keep opening data files, we hit max-open-files limit.
+            // Close files that are no longer referenced.
+            DataFile::clear_cache();
     
             try
             {
@@ -322,7 +333,7 @@
         printf("- Index %zd: %s\n", val_idx, stamp_txt.c_str());
 #endif
         if (high-low <= 1)
-        {   // The intervall can't shrink further.
+        {   // The interval can't shrink further.
             // idx == high because of up-rounding above.
             // Which value's best?
             LOG_ASSERT(val_idx == high);
Index: Storage/RawValue.cpp
===================================================================
--- Storage/RawValue.cpp	(revision 11617)
+++ Storage/RawValue.cpp	(working copy)
@@ -116,12 +116,12 @@
         return;
     }
 
-    if (severity < (short)SIZEOF_ARRAY(alarmSeverityString)  &&
-        (short)value->status < (short)SIZEOF_ARRAY(alarmStatusString))
+    if (severity < (short)SIZEOF_ARRAY(epicsAlarmSeverityStrings)  &&
+        (short)value->status < (short)SIZEOF_ARRAY(epicsAlarmConditionStrings))
     {
-        result = alarmSeverityString[severity];
+        result = epicsAlarmSeverityStrings[severity];
         result += " ";
-        result += alarmStatusString[value->status];
+        result += epicsAlarmConditionStrings[value->status];
     }
     else
     {
@@ -190,17 +190,17 @@
         return true;
     }
     short i, j;
-    for (i=0; i<(short)SIZEOF_ARRAY(alarmSeverityString); ++i)
+    for (i=0; i<(short)SIZEOF_ARRAY(epicsAlarmSeverityStrings); ++i)
     {
-        if (!strncmp(text.c_str(), alarmSeverityString[i],
-                     strlen(alarmSeverityString[i])))
+        if (!strncmp(text.c_str(), epicsAlarmSeverityStrings[i],
+                     strlen(epicsAlarmSeverityStrings[i])))
         {
             sevr = i;
-            stdString status = text.substr(strlen(alarmSeverityString[i]));
+            stdString status = text.substr(strlen(epicsAlarmSeverityStrings[i]));
 
-            for (j=0; j<(short)SIZEOF_ARRAY(alarmStatusString); ++j)
+            for (j=0; j<(short)SIZEOF_ARRAY(epicsAlarmConditionStrings); ++j)
             {
-                if (status.find(alarmStatusString[j]) != stdString::npos)
+                if (status.find(epicsAlarmConditionStrings[j]) != stdString::npos)
                 {
                     stat = j;
                     return true;
Index: Engine/EngineConfig.h
===================================================================
--- Engine/EngineConfig.h	(revision 11617)
+++ Engine/EngineConfig.h	(working copy)
@@ -116,6 +116,7 @@
                             const stdString &channel_name,
                             double scan_period,
                             bool disabling, bool monitor) = 0;
+	virtual ~EngineConfigListener() { }
 };
 
 /** \ingroup Engine
Index: Engine/ProcessVariableListener.h
===================================================================
--- Engine/ProcessVariableListener.h	(revision 11617)
+++ Engine/ProcessVariableListener.h	(working copy)
@@ -20,6 +20,7 @@
     /** Invoked when the pv disconnects. */
     virtual void pvDisconnected(class ProcessVariable &pv,
                                 const epicsTime &when) = 0;
+	virtual ~ProcessVariableStateListener() { }
 };
 
 /**\ingroup Engine
@@ -34,6 +35,7 @@
      */
     virtual void pvValue(class ProcessVariable &pv,
                          const RawValue::Data *data) = 0;
+	virtual ~ProcessVariableValueListener() { }
 };
 
 /**\ingroup Engine
@@ -43,6 +45,8 @@
     : public ProcessVariableStateListener,
       public ProcessVariableValueListener
 {
+public:
+	virtual ~ProcessVariableListener() { }
 };
 
 #endif /*PROCESSVARIABLESTATELISTENER_H_*/
Index: Engine/ArchiveChannelStateListener.h
===================================================================
--- Engine/ArchiveChannelStateListener.h	(revision 11617)
+++ Engine/ArchiveChannelStateListener.h	(working copy)
@@ -22,6 +22,7 @@
     virtual void acDisconnected(class Guard &guard,
                                 class ArchiveChannel &pv,
                                 const epicsTime &when) = 0;
+	virtual ~ArchiveChannelStateListener() { }
 };
 
 #endif /*ARCHIVECHANNELSTATELISTENER_H_*/
Index: Engine/ProcessVariableTest.cpp
===================================================================
--- Engine/ProcessVariableTest.cpp	(revision 11617)
+++ Engine/ProcessVariableTest.cpp	(working copy)
@@ -50,6 +50,7 @@
                num, pv.getName().c_str(), tim.c_str(), val.c_str());
         ++values;
     }
+	virtual ~PVTestPVListener() { }
 };
 
 TEST_CASE process_variable()
Index: Engine/EngineConfigTest.cpp
===================================================================
--- Engine/EngineConfigTest.cpp	(revision 11617)
+++ Engine/EngineConfigTest.cpp	(working copy)
@@ -18,6 +18,7 @@
                (monitor ? "monitor" : "scan"),
                (disabling ? ", disabling" : ""));
     }
+	virtual ~MyListener() { }
 };
 
 TEST_CASE engine_config()
Index: make.cfg
===================================================================
--- make.cfg	(revision 11617)
+++ make.cfg	(working copy)
@@ -9,7 +9,7 @@
 # Only build this one for the host architecture,
 # not for any cross-platforms that might be defined
 # for EPICS base
-CROSS_COMPILER_TARGET_ARCHS=
+#CROSS_COMPILER_TARGET_ARCHS=
 
 # Profiling:
 #USR_CXXFLAGS += -pg
@@ -37,14 +37,13 @@
 
 # EPICS base includes
 USR_CXXFLAGS += -I$(EPICS_BASE)/include -I$(EPICS_BASE)/include/os/$(OS_CLASS)
-USR_CXXFLAGS += -I/afs/slac/g/lcls/tools/linux-x86/include
 
 # Base directory of the XML-RPC C library installation
-XMLRPCBASE=/afs/slac/g/lcls/tools/linux-x86
+XMLRPCBASE=
 
 # Location of Xerces or Expat library, however Tools/FUX.h is configured
-USR_LDFLAGS += -L/afs/slac/g/lcls/tools/linux-x86/lib -lxerces-c
 #USR_LDFLAGS += -lexpat
+USR_LDFLAGS += -lxerces-c
 
 VALGRIND_FLAGS = --tool=memcheck --leak-check=yes --show-reachable=yes --num-callers=10
 
Index: ExampleSetup/ArchiveDaemon.pl
===================================================================
--- ExampleSetup/ArchiveDaemon.pl	(revision 11617)
+++ ExampleSetup/ArchiveDaemon.pl	(working copy)
@@ -25,7 +25,7 @@
 use IO::Handle;
 use Data::Dumper;
 use XML::Simple;
-use POSIX 'setsid';
+use POSIX qw(setsid tmpnam);
 use vars qw($opt_h $opt_p $opt_f $opt_i $opt_u $opt_d);
 use Getopt::Std;
 
@@ -68,7 +68,8 @@
 my ($localhost) = "127.0.0.1";
 
 # What ArchiveEngine to use. Just "ArchiveEngine" works if it's in the path.
-my ($ArchiveEngine) = "ArchiveEngine";
+#my ($ArchiveEngine) = "ArchiveEngine";
+my ($ArchiveEngine) = "/reg/g/pcds/package/epics/3.14/extensions/current/bin/linux-x86_64/ArchiveEngine";
 
 # Seconds between "is the engine running?" checks.
 # We _hope_ that the engine is running all the time
@@ -389,6 +390,25 @@
     return \*HTTP;
 }
 
+sub handle_HTTP_remake($$)
+{
+    my ($client, $hutch) = @ARG;
+    my $file = tmpnam();
+    html_start($client, 1);
+    print $client "Remaking archiver PV lists.<BR><BR>";
+    system("../config/scripts/pcds_update_lists.sh " . $hutch . " >" . $file . " 2>&1");
+    system("../config/scripts/error_notify.sh " . $file);
+    print $client "Script output (should be empty):<BR>";
+    open (MYFILE, $file);
+    while (<MYFILE>) {
+ 	chomp;
+ 	print $client "&nbsp;&nbsp;&nbsp;&nbsp;$_<BR>\n" if $_ !~ /Converting|^~|validates/;
+    }
+    close (MYFILE);
+    system("mv " . $file . " ../pcds_update_lists.log");
+    html_stop($client);
+}
+
 sub handle_HTTP_main($)
 {
     my ($client) = @ARG;
@@ -686,6 +706,16 @@
             handle_HTTP_postal($client);
             return 0;
         }
+        elsif ($URL eq '/remake')
+        {
+            handle_HTTP_remake($client, "");
+            return 1;
+        }
+        elsif ($URL =~ '/remake/([a-zA-Z]+)')
+        {
+            handle_HTTP_remake($client, $1);
+            return 1;
+        }
         elsif ($URL =~ m'/disable/([0-9]+)')
         {
             handle_HTTP_disable($client, $1);
@@ -771,8 +801,7 @@
 sub make_indexname($$)
 {
     my ($now, $engine) = @ARG;
-    my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)
-    = localtime($now);
+    my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime($now);
     if ($config->{engine}{$engine}{restart}{type} eq "hourly")
     {
         return sprintf("%04d/%02d_%02d_%02dh/index",
@@ -781,6 +810,17 @@
     if ($config->{engine}{$engine}{restart}{type} eq "daily"  or
         $config->{engine}{$engine}{restart}{type} eq "timed")
     {
+#
+# Move this to Thursday!  (This agrees with our config.  If we change the config,
+# we should change this too!)
+#
+	if ($wday >= 4) {
+	    ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)
+		= localtime($now - ($wday - 4)*3600*24);
+	} else {
+	    ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)
+		= localtime($now - ($wday + 3)*3600*24);
+	}
         return sprintf("%04d/%02d_%02d/index", 1900+$year, 1+$mon, $mday);
     }
     return "index";
@@ -961,9 +1001,15 @@
         add_message("Creating dir '$new_data_path'\n");
         mkpath($new_data_path);
     }
-    my ($EngineLog) = time_as_short_text($now) . ".log";
-    my ($EngineOut) = time_as_short_text($now) . ".out";
-    my ($cmd) = "cd \"$engine\";" .
+    my ($LogDir) = $engine . "/logs";
+    if ( not -d $LogDir )
+    {
+        add_message( "Creating dir '$LogDir'\n" );
+        mkpath( $LogDir );
+    }
+    my ($EngineLog) = "logs/" . time_as_short_text($now) . ".log";
+    my ($EngineOut) = "logs/" . time_as_short_text($now) . ".out";
+    my ($cmd) = "cd \"$engine\"; " .
         "$ArchiveEngine -d \"$config->{engine}{$engine}{desc}\" -l $EngineLog " .
         "-p $config->{engine}{$engine}{port} $config->{engine}{$engine}{config} $index >$EngineOut 2>&1 &";
     print(time_as_text(time), ": Command: '$cmd'\n");
Index: Makefile
===================================================================
--- Makefile	(revision 11617)
+++ Makefile	(working copy)
@@ -3,6 +3,7 @@
 TOP=../..
 include $(TOP)/configure/CONFIG
 
+
 DIRS += Tools
 DIRS += LibIO
 DIRS += Storage

Replies:
Re: copying archived data from 32-bit to 64-bit machine Pierrick Hanlet
References:
copying archived data from 32-bit to 64-bit machine Pierrick Hanlet
Re: copying archived data from 32-bit to 64-bit machine James F Ross
Re: copying archived data from 32-bit to 64-bit machine Pierrick Hanlet
RE: copying archived data from 32-bit to 64-bit machine Kasemir, Kay

Navigate by Date:
Prev: Re: BOY number representation & display scaling Paul Sichta
Next: Re: copying archived data from 32-bit to 64-bit machine Pierrick Hanlet
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: RE: copying archived data from 32-bit to 64-bit machine Kasemir, Kay
Next: Re: copying archived data from 32-bit to 64-bit machine Pierrick Hanlet
Index: 1994  1995  1996  1997  1998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  <20132014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 20 Apr 2015 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·