# urbestack-backup-run

First published 3 Oct 2026 (release 0.1.0) · Unchanged since publication

UrbeStack release 0.2.35 command, run as root in the server shell.

## Usage

```
urbestack-backup-run [--day YYYY-MM-DD] [--job ID] [--no-remote]
urbestack-backup-run --user NAME [--day YYYY-MM-DD] [--job ID]
urbestack-backup-run --copy-only
```

## Description

Creates the server's backup for the day. The urbestack-backup.timer runs it nightly at backups.hour, and the Backups section can start it as a job. On a new installation, backups.enabled is off. While it is off, the timer is disabled and the command refuses to run, naming the setting. If another backup run is already in progress, the command refuses and reports its job ID.

backups.dir (/backups by default) must exist, be owned by root, and be writable only by root. The day folder is owned by root with mode 0700. It holds server.json, the server profile export including its secrets, and a <user>.tar.gz archive for each customer backed up. The files are owned by root with mode 0600. Each file is written with a .part suffix and renamed when complete. Rerunning a backup for the same day replaces the files it writes.

The run backs up customers one at a time if their nightly backup switch is on. It skips suspended customers when backups.skip_suspended is on. If an archive fails or is refused for insufficient disk space, the run reports that customer and continues. Afterward it removes day folders beyond backups.keep_days, oldest first. Each run records one audit entry and sends subscribed administrators one backups.failed email if any archives failed and one backups.refused email if any were refused. A clean run sends neither.

Use --day to select the day folder by date in YYYY-MM-DD format, for example when testing. The default is the current day. Use --job to attach the run to an existing worker job by ID. If omitted, the command creates a job so the run appears in the Backups section.

When backups.remote_host is set, the run uses rsync to copy the newest day folders up to backups.remote_keep_days and removes older day folders on the remote host. A failed copy sends one backups.remote_failed email and preserves the local archives. Use --no-remote to skip the copy. Use --copy-only by itself to copy existing backups, for example after an overnight remote outage. It requires backups.remote_host, backups.remote_user, and backups.remote_path.

Use --user to back up one named account in the nightly archive format alongside a fresh server.json, regardless of the account's nightly backup switch or suspension status. This is what Back up now does in the Backups section, for example to retry a failed or refused backup once disk space is available. This run skips retention and remote copying. The nightly run handles the folder.

## Command family: backup

- [urbestack-backup-account-list](https://urbestack.com/docs/commands/urbestack-backup-account-list.md): Lists customers as shown in the Backups section of the administrator's panel, with each customer's name, package and account state.
- [urbestack-backup-del](https://urbestack.com/docs/commands/urbestack-backup-del.md): Deletes one of the customer's own archives from backups/ in their home directory.
- [urbestack-backup-exclude-add](https://urbestack.com/docs/commands/urbestack-backup-exclude-add.md): Adds a path to the customer's backup exclusions.
- [urbestack-backup-exclude-del](https://urbestack.com/docs/commands/urbestack-backup-exclude-del.md): Removes an exclusion from the customer's backup list.
- [urbestack-backup-exclude-list](https://urbestack.com/docs/commands/urbestack-backup-exclude-list.md): Lists the customer's backup exclusions in path order.
- [urbestack-backup-exclude-set](https://urbestack.com/docs/commands/urbestack-backup-exclude-set.md): Locks or unlocks a customer's backup exclusion.
- [urbestack-backup-list](https://urbestack.com/docs/commands/urbestack-backup-list.md): Lists the customer's own archives in backups/ at the top of their home directory, newest first.
- [urbestack-backup-make](https://urbestack.com/docs/commands/urbestack-backup-make.md): Creates a .tar.gz archive for one customer or reseller.
- [urbestack-backup-remote-key](https://urbestack.com/docs/commands/urbestack-backup-remote-key.md): Shows the public key and fingerprint of UrbeStack's Ed25519 key pair for remote backups, along with any recorded host key.
- [urbestack-backup-remote-test](https://urbestack.com/docs/commands/urbestack-backup-remote-test.md): Tests the remote backup destination, as the Test button does.
- [urbestack-backup-status](https://urbestack.com/docs/commands/urbestack-backup-status.md): Shows the backup status displayed in the Backups section and on the dashboard card in the administrator's panel.
