Task: Relocate Analysis Files

If you need to relocate the files associated with a particular analysis, it is important to make sure that the hub associated with the analysis is informed of the new location. Otherwise, some information about the corresponding analysis will be unavailable - see Source File: Availability and Procedure: Availability for more information. (However, the hub will interact normally with subsequent analyses carried out in the new directory.)

If you specify the -remote-archive option when you build and analyze a project, the analysis files will be automatically moved to the corresponding location when the analysis transitions to daemon mode.



Permissions Needed For This Task

Relocating a particular analysis A of project P requires the following permissions.

You will also need sufficient file system permissions to copy the analysis directory (in general, this means that you will need read permission on that directory and its contents).

Relocate Analysis Files

In this example we have analyzed project myproj in directory /old/dirpath/ with results sent to the hub at host:port, but wish to move the analysis files to /new/path/to/ and carry out future analyses in that directory.

  1. Sign in to the CodeSonar web GUI as a user with G_HUB_DEBUG permission.
  2. Visit http://host:port/command/close_all/ to instruct all daemons to disconnect from the hub and exit.
    (See the close_all documentation for more details.)
  3. Move the myproj.prj and myproj.conf files, and the myproj.proj_files directory.
    mv /old/dirpath/myproj.prj /new/path/to/myproj.prj
    mv /old/dirpath/myproj.conf /new/path/to/myproj.conf
    mv /old/dirpath/myproj.prj_files /new/path/to/myproj.prj_files
  4. Inform the hub of the new location.
    codesonar relocate auth /new/path/to/myproj host:port
    where auth is a set of suitable authentication arguments.
  5. If CodeSonar prompts you for user name and password, enter the username and password for your hub user account.
    The command will notify the hub of the new analysis location.

The relocate command interacts with the hub at host:port through a launch daemon running on the same Machine as the relocate command, from the same Installation, as the same System User, and authorized by the same Hub User. If such a launch daemon is not already running, CodeSonar will start one. The Analysis Launch Daemon for the analysis will be set to this launch daemon.

Links