Workspaces/Advanced Features/ws register

From bwHPC Wiki
< Workspaces‎ | Advanced Features
Revision as of 16:51, 2 December 2025 by M Janczyk (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

ws_register - Create Workspace Links

Creates symbolic links to all your workspaces in one convenient directory.

Basic Usage

  $ ws_register ~/workspaces               # Create links in ~/workspaces

The command creates subdirectories for each filesystem (e.g., scratch/) with links to your workspaces.

Example

  $ mkdir -p ~/my_workspaces
  $ ws_register ~/my_workspaces
  $ ls -l ~/my_workspaces/scratch/
  lrwxrwxrwx ... user-myWs -> /work/workspace/scratch/user-myWs-0
  lrwxrwxrwx ... user-project1 -> /work/workspace/scratch/user-project1-0

Note: Links include the full workspace name (with username prefix).

Options

Option Description
directory Target directory for links (required)
-F <filesystem> Only create links for workspaces on specific filesystem
-h, --help Show help
--version Show version

When to Use

  • Working with multiple workspaces
  • Need quick access from one location
  • Organizing workspaces by project

Automatic Updates

Add to ~/.bashrc to update links automatically at login:

# Only run in interactive shells
if [ -t 0 ] && [ -z "$SSH_ORIGINAL_COMMAND" ] && command -v ws_register >/dev/null 2>&1; then
    mkdir -p ~/workspaces 2>/dev/null
    ws_register ~/workspaces 2>/dev/null
fi

For more information: ws_register -h or man ws_register