Top
ETERNUS SF AdvancedCopy Manager V15.3 Operation Guide
ETERNUS

A.2.2 Post-processing of backup

The name of a script file for post-processing of a backup is as follows.

In the case of non-cluster operation
<Environment directory>\etc\backup\scripts\OpcBackupPost.js
In the case of cluster operation
<Shared disk>:\etc\opt\swstorage\etc\backup\scripts\OpcBackupPost.js

A.2.2.1 Post-processing script for backup

  1: // AdvancedCopy Manager for Windows
  2: // All Rights Reserved, Copyright FUJITSU LIMITED, 2002-2009
  3: //
  4: // OpcBackupPost.js: Post-Processing Script for swstbackup
  5: //
  6: // [Parameters]
  7: // 1st argument: device name of transaction volume
  8: //
  9: // [Return Values]
 10: // 0: The script ended normally.
 11: // 2: The number of the arguments is incorrect.
 12: // (1,3,5-8): not used, but must not be used because older versions use these values.
 13: // 4: An error other than the above occurred.
 14: 
 15: try {
 16:    // create global objects
 17:    var WshShell = WScript.CreateObject("WScript.Shell");              // create Shell object
 18:    var WshEnv    = WshShell.Environment("PROCESS");                    // create Environment object
 19:    var fsObj= WScript.CreateObject("Scripting.FileSystemObject"); // create FileSystemObject object
 20: 
 21:    // create SwstBackupPostProc object
 22:    var proc = new SwstBackupPostProc();
 23: 
 24:    // do nothing if postprocessing file exists
 25:    if (fsObj.FileExists(proc.postFileName) == false) {
 26:  SwstQuit(0);
 27:    }
 28: 
 29:    // get postprocessing type
 30:    var postProcType = proc.getPostProcData(proc.postFileName);
 31:    switch(postProcType) {
 32:    case "none":
 33:  proc.doNothing();
 34:  break;
 35:    }
 36: 
 37:    // do nothing if postprocessing file exists
 38:    if (fsObj.FileExists(proc.bdFileName) == true) {
 39:  var bvName = proc.getPostProcData(proc.bdFileName);
 40:  proc.doNothing();
 41:    }
 42: 
 43:    // clear temporary files
 44:    proc.deletePostFile(proc.postFileName);
 45:    proc.deletePostFile(proc.bdFileName);
 46:    SwstQuit(0);
 47: } catch (e) {
 48:    SwstQuit(6);
 49: }
 50: 
 51: function SwstBackupPostProc()
 52: {
 53:    // member variables
 54:    this.tvName   = WScript.Arguments.length!=1?SwstQuit(1):WScript.Arguments.Item(0); // device name of transaction volume
 55:    this.postFileName = getDataPathName() + "\\" + getPutFileName(this.tvName) + ".pre";    // name of postprocessing file
 56:    this.bdFileName   = getDataPathName() + "\\" + getPutFileName(this.tvName) + ".bd";    // name of postprocessing file
 57: 
 58:    // member functions
 59:    this.getPostProcData    = getPostProcData;     // self-explanatory
 60:    this.doNothing      = doNothing;            // self-explanatory
 61:    this.deletePostFile= deletePostFile;      // self-explanatory
 62: }
 63: 
 64: function getPostProcData(postfile)
 65: {
 66:    var iomode = 1; // means read-only mode
 67:    var create = false; // means not to create a file
 68:    var postFileStream = fsObj.OpenTextFile(postfile, iomode, create);
 69:    var postData = postFileStream.ReadAll();
 70:    postFileStream.Close();
 71:    return postData;
 72: }
 73: 
 74: function doNothing()
 75: {
 76:    // do nothing
 77: }
 78: 
 79: function deletePostFile(postfile)
 80: {
 81:    if (fsObj.FileExists(postfile) == true) {
 82:  fsObj.DeleteFile(postfile);
 83:    }
 84: }
 85: 
 86: function SwstQuit(exitStatus)
 87: {
 88:    switch(exitStatus) {
 89:    case 0:
 90:  WScript.Quit(0);
 91:    case 1:
 92:  WScript.Echo("[Backup Postprocessing] The number of the arguments is incorrect.");
 93:  WScript.Quit(2);
 94:    default:
 95:  WScript.Echo("[Backup Postprocessing] The script exited abnormally.");
 96:  WScript.Quit(4);
 97:    }
 98: }
 99: 
100: function getDataPathName()
101: {
102:    return WshShell.RegRead(getSetupInfoKey() + "\\etcPathName") + "\\etc\\backup\\data\\DEFAULT";
103: }
104: 
105: function getBinPathName()
106: {
107:    return WshShell.RegRead(getSetupInfoKey() + "\\PathName") + "\\bin";
108: }
109: 
110: function getSetupInfoKey()
111: {
112:    var nodeName = WshEnv.Item("SWSTGNODE");
113:    if( nodeName != "" ){
114:  return "HKEY_LOCAL_MACHINE\\SOFTWARE\\Fujitsu\\AdvancedCopy Manager\\CurrentVersion\\" + nodeName;
115:    }
116:    return "HKEY_LOCAL_MACHINE\\SOFTWARE\\Fujitsu\\AdvancedCopy Manager\\CurrentVersion";
117: }
118: 
119: function getPutFileName(deviceName){
120:    var fileName;
121:    if( isSafeDISKName(deviceName) ){
122:  var re = /(\S+)\/(\S+):(\S+)/;
123:  fileName = deviceName.replace(re, "$1_$2_$3");
124:    }else{
125:  fileName = deviceName;
126:    }
127:    return(fileName);
128: }
129: 
130: function getGXDXPX(deviceName){
131:    var gXdXpX;
132:    if( isSafeDISKName(deviceName) ){
133:  var re = /(\S+)\/(\S+):(\S+)/;
134:  gXdXpX = deviceName.replace(re, "$3");
135:    }else{
136:  gXdXpX = deviceName;
137:    }
138:    return(gXdXpX);
139: }
140: 
141: function isSafeDISKName(deviceName){
142:    var key = ":g";
143:    var s = deviceName.indexOf(key);
144:    if ( s < 0 ) {
145:  return (false);
146:    } else {
147:  return (true);
148:    }
149: }

Point

The transaction volume is locked/unlocked, and the buffer is flushed by the command, not by the script. Therefore, the backup pre-processing script and backup post-processing script are executed immediately before and after (respectively) the transaction volume is locked/unlocked and the buffer is flushed. The backup pre-processing and post-processing scripts do not perform any processing.

Figure A.3 Snapshot-type backup (OPC)

Figure A.4 Synchronous-type backup (EC) in a non-clustered system

Figure A.5 Synchronous-type backup (EC) in a clustered system operation

Note

  • In the pre-processing for synchronous processing and the backup pre-processing, to avoid a temporary access contention with other applications, locking is retried if it cannot complete its operation. If the number of times the command is executed reaches the specified retry limit, locking ends abnormally.

    If an abnormal end occurs, any process that is using the transaction volume or backup volume remains active. Stop all applications and services involved or take other appropriate measures so that the volume cannot be used by another process.

    The retry limit can be changed by creating volume locking specification files and re-setting the limit (for details of these files, refer to "A.2.3 Transaction volume locking specification file for backups" and to "A.2.4 Backup volume locking specification file for backups"). However, the files do not need to be created if appropriate measures have been taken to prevent other processes from using the target volumes during backup processing execution.

  • For a synchronous-type backup in a clustered system operation, in order to prevent the clustered system from being monitored, the backup volume is locked only while the backup synchronous processing start command and the backup execution command are running (refer to the figure above). That is, the backup volume remains unlocked from the time that the backup synchronous processing start command is executed to the time that the backup execution command is executed.

    This may cause a message to be output to the event log. This message is described in "13.1.1.12 Error messages displayed an event viewer" in "13.1.1 General notes". Since there is no problem, the message can be ignored.