dyndmp and dyndumpsetopt
The Dynamic Dump can send a script to the server and receive a dump stream and/or status messages from the server. The following capabilities are available for scripting a dynamic dump:
To use these options, call the function dyndmpsetopt() before calling dyndmp():
extern NINT dyndmpsetopt(NINT option,pVOID value);
The following are the supported options. All options are disabled by default.
dyndmpsetopt(DDOPT_SENDSCRIPT, "script.txt");
dyndmpsetopt(DDOPT_RECVSTREAM, (pVOID) YES);
dyndmpsetopt(DDOPT_RECVSTATUS, (pVOID) YES);
extern ctCONV NINT mycallback(pVOID pctx,pVOID pdata,NINT datalen,NINT opcode);
dyndmpsetopt(DDOPT_SETCALLBK , &mycallback);
mystruct mycontext;
dyndmpsetopt(DDOPT_SETCONTEXT, &mycontext);
dyndmpsetopt(DDOPT_SETBUFSIZ, (pVOID) 100000);
Notes:
1) The dump options remain in effect for all dynamic dumps performed by the current connection until they are changed.
2) When the DDOPT_RECVSTREAM or DDOPT_RECVSTATUS options are used, the following dynamic dump script options are ignored:
COPY_NONCTREE - Non-ctree files cannot be copied.
DATE and TIME - No scheduling of dump for later time.
EXT_SIZE - Only one dump extent is created.
FREQ - No repeat of dump.
SEGMENT - No segmenting of dump stream.
The ctdump utility supports these features through command-line options:
usage: ctdump [-s svn] [-u uid] [-p upw] [-t script] [-b bufsiz] [-n] [-c] [-o backup]
Options:
Example:
# ctdump -u ADMIN -p ADMIN -o backup.fcd -c -t script.txt -s FAIRCOMS -n
Results:
c-tree(tm) Version 11.1.0.46197(Build-150826) Dynamic Backup Utility
Copyright (C) 1992 - 2015 FairCom Corporation
ALL RIGHTS RESERVED.
Reading dump stream from server with buffer size of 100000
Start dump. Estimated dump size: 2691072
FAIRCOM.FCS
86% 100% [ 2328576 of 2326528 bytes]
SYSLOGDT.FCS
89% 100% [ 86016 of 81920 bytes]
SYSLOGIX.FCS
99% 100% [ 266240 of 262144 bytes]
S0000000.FCS
100% 100% [ 4096 of 128 bytes]
S0000001.FCS
100% 100% [ 4096 of 128 bytes]
L0000001.FCS
100% 100% [ 2048 of 679 bytes]
End dump. Actual dump size: 2705408
Dynamic Dump has been successfully written to the file backup.fcd.
See Also:
Changes to the ctree Library
To safely support directing the dump to stdout, the ctree library has been updated so it does not internally write to stdout, which would corrupt the dump stream. To accomplish this, references to stdout/stderr were replaced with macros CT_STDOUT, CT_STDERR, which are now controlled by internal functions:
extern ctCONV FILE * ctDECL getCtreeSTDOUT(void);
extern ctCONV FILE * ctDECL getCtreeSTDERR(void);
extern void ctDECL setCtreeSTDOUT(FILE * out);
extern void ctDECL setCtreeSTDERR(FILE * err);
We have updated references to the following to allow other c-tree utilities to make use of stdout redirection for greater conformance to Unix behavior standards: