KBEC-00033 - Creating a backup workspace and retaining current jobs

Article ID:360032832412
2 minute readKnowledge base

Summary

Workspaces can grow to large numbers of job entries. A quick method for archiving jobs is to create a second workspace and make the first workspace a backup workspace to the newly created workspace. To do this, use the ElectricCommander feature called Alternate Workspace For Display, implemented through a workspace property named alternateWorkspaceForDisplay.

Solution example

For a workspace named A:

  1. Create a new workspace named B.

  2. Set the alternate workspace for display to a workspace named C.
    Do this by creating a property on workspace B called alternateWorkspaceForDisplay and setting its value to the name of the alternate workspace, C.

  3. Stop the Commander server.
    If you are unable to stop the server, currently running jobs using workspace A will fail while the next two steps are executed.

  4. Rename workspace A to C.

  5. Rename workspace B to A.

  6. Start the Commander server if you had previously stopped it.

Chaining alternateWorkspaceForDisplay

If you require multiple archives to be made, you can chain alternateWorkspaceForDisplay. The instructions above only cover the process to archive once but can be repeated to create a chain of workspaces connected by alternateWorkspaceForDisplay properties. For example:

  • Job that used workspace A.

  • Workspace A has been renamed to C and a new workspace A has been created.

  • Therefore, job’s logs are now in workspace C.

  • Workspace A has alternateWorkspaceForDisplay B.

  • Workspace B has alternateWorkspaceForDisplay C.

  • The server will first look for the logs in workspace A’s directory.

  • If it’s not found, it will look inside workspace B’s directory.

  • If it’s not found, it will look inside workspace C’s directory where it will finally find the logs.

In this example, workspace A is being used as the current workspace. Workspace B and workspace C are used as two different archives of A. All jobs with logs archived in B or C will still be able to display the logs in the UI because of the alternateWorkspaceForDisplay chain.

Moving the files

If you need to move log files to another directory, you can also use alternateWorkspaceForDisplay to do this. For example:

  • Job used workspace A with path /workspace

  • Logs need to be moved to /archive

  • Define a new workspace B with path /archive

  • Set the alternateWorkspaceForDisplay property on workspace A to workspace B

  • Move the files/folders

    • mv /workspace/job_directory /archive

  • The server will look for the logs in workspace A

  • If not found, the server will look for the logs in workspace B where it finds the logs in /archive

Applies to

  • Product versions: pre-8.3 releases of ElectricCommander

  • OS versions: Linux and Windows