Back to lessons

Hosting Operations

Check the Current Release Symlink

You need to verify which release directory a site is serving.

Command

readlink -f /srv/www/example.com/current

What changed

Nothing changes. The command resolves the live symlink target.

Danger

safe

When to use it

Use this after a deploy or rollback.

When not to use it

Do not delete old releases until you know rollback requirements.

Undo or recovery

No state is changed.

Expected output

The absolute path of the active release directory.

demo script

Disposable terminal steps

  1. readlink -f /srv/www/example.com/current
  2. find /srv/www/example.com/releases -maxdepth 1 -type d | sort
  3. curl -I http://127.0.0.1

simulated output

What it looks like

disposable vessel
::fixture-ready::
$ readlink -f /srv/www/example.com/current
/srv/www/example.com/releases/20260625T110000Z
::exit-code::0
$ find /srv/www/example.com/releases -maxdepth 1 -type d | sort
/srv/www/example.com/releases
/srv/www/example.com/releases/20260625T100000Z
/srv/www/example.com/releases/20260625T110000Z
::exit-code::0
$ curl -I http://127.0.0.1
HTTP/1.1 200 OK
server: fake-nginx

::exit-code::0

YouTube Short

Which release is live?

If deploys use a current symlink, resolve it before debugging the wrong release.

LinkedIn hook

The deploy finished. The symlink told me what was actually live.

Question: Do your deploys expose a current symlink or release marker?

experiments

A/B tests to run

Metric: linkedin_comment_rate

A: Check the current release symlink.

B: The symlink told me what was actually live.