CaseCopy - a kfx tool for enhanced productivity.
Copying a KFX case properly is not a simple task as it seems. A naive approach is to just copy the case folder, and if the case is set up with care this will work. The KFX distribution provides a casecopy, now renamed to copycase. This tool was designed to make copies of scenarios and run them on the same computer. The CaseCopy of oneKfx aims to prepare the scenario to be executed on a remote computer.
CaseCopy improved
A proper CaseCopy tool makes it easier to:
- Duplicate a case for simple parameter variation
- Set up a case on a desktop computer and run on a server (batch)
- Archiving the case (storing only what is needed to rerun the case)
CaseCopy aims to copy a case to a new location on the same computer and only copy files that are required.
Basic usage
Running casecopy without arguments yields:
> casecopy
Required argument missing for command: 'casecopy'.
Description:
Copy all files required to run a Kameleon Fire-eXsim (KFX) case.
see http://onekfx.dnv.com/CaseCopy.html for a detailed explanation of this program.
Usage:
casecopy <CaseFrom> [<CaseTo>] [options]
Arguments:
<CaseFrom> The source folder or KFX case file (fsc, scn or json).
<CaseTo> The destination. If omitted, it will use current directory and the folder of the source (CaseFrom)
[default: Folder of CaseFrom]
Options:
-r, --restart <IFIL> Copy and set restart file number (IFIL). All=All restart files, 0=start from time=0, 1=restart
file 001, -1 =last restart file, -2 =second last.
-f, --Force-Copy Overwrite destination files if exists.
-l, --Keep-local Do not copy absolute path files as when working on local servers.
-z, --Zip-Dest Zip destination.
-n, --Dry-Run Show what files would be copied, but not do it.
-p, --Plain-Text Report actions in plain text.
--version Show version information
-?, -h, --help Show help and usage information
Understanding CaseFrom
A folder may contain many KFX scenarios, so when You specify a folder it must either contain case.dat or a single fsc, scn or json file. If it contains a case.dat it will use the fsc scenario it refers to (as KFX would). To override You can specify explicitly the casefile (folder/case1.fsc). You must specify a CaseFrom argument.
CaseTo
CaseTo is optional and if omitted it will use the casename as found in CaseFrom and same folder. This means if You type >casecopy test1 then CaseFrom and CaseTo will be the same. if inside test1 folder “>casecopy .” will translate to currentFolder (test1) CaseTo would be currentFolder/test1. “>casecopy case1.fsc case2.fsc” Will copy to same folder and change case in case.dat.
Options
By specifying the -r option You copy along the restart files and change the fsc so that it restarts from the specific restart file. CaseCopy tries to not override destination if there are files there already, use -f to override this behavior. Sometimes You want to make a copy to execute on the same machine as You are running on, then the -l option is good if You want to save some disk space as it does not copy file references with absolute path. If You have issues with the colorized terminal output use -p option to turn colors off.