1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 <2013> 2014 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 <2013> 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 |
<== Date ==> | <== Thread ==> |
---|
Subject: | RE: autosave per-db req files |
From: | Emmanuel Mayssat <[email protected]> |
To: | "Stubbs, Scott A." <[email protected]>, "[email protected]" <[email protected]> |
Date: | Wed, 21 Aug 2013 13:33:53 -0700 |
> 1) Is there a way automatically to make an autosave-request file for a given database file, or for a given set of database files? > > No, because only the database author knows which PVs should be restored to put the database back in the Maybe. The trick consist in generating the req file with an IOC that only load the db files you want to autosave. The question then becomes how can you easily change the loaded db files in an IOC A trick I commonly use is the 'include' directive of iocsh In short, < ${DBL_DIR}/device1_preIocInit.dbl #< ${DBL_DIR}/device2_preIocInit.db < ${DBL_DIR}/device3_preIocInit.dbl < ${DBL_DIR}/autosave_preIocInit.dbl iocInit < ${DBL_DIR}/device1_postIocInit.dbl #< ${DBL_DIR}/device2_postIocInit.dbl < ${DBL_DIR}/device3_postIocInit.dbl < ${DBL_DIR}/autosave_postIocInit.dbl You can push this to the extreme as include files can also include other include files. As such you can drastically change your IOC with just a few well placed # signs. Here I run the code with only device1 and device3 and generate the req autosave file Then in a flash I reconfigure my IOC to run with that req file. In practice I generate a autosave file for each of my devices/drivers so that an autosave file for device1 and device3 is actually 2 autosave files. In other words, my autosave files become 'atomic', i.e it doesn't make sense to break them into smaller units. > 2) If you already have autosave-request files for all the databases you will load, is there a way automatically to invoke > autosave create_xxx_set() commands for each of those request files? > > Sort of. If you have the PVs that are to be restored listed in info nodes in the database, and if the names of Under **certain** conditions, you may be able to do something like this dbgrep DEVICE_1_PREFIX*O > file1.req ( <-- O is the suffix for PVs to autosave) dbgrep DEVICE_3_PREFIX*O > file3.req If required, you may use PV aliases or create PV that point to important fields. But with the appropriate naming and design convention, you will not have conformity issues. Then in the respective deviceX_postIocInit include you simply read the file1.sav and file3.sav -- Emmanuel |