/go/snapshot: snapshot from the Command Line

/go/snapshot keeps point-in-time copies of hosting accounts in restic repositories, one repository per domain. It: Snapshots are stored on a remote (through rclone) when one is configured, and in /var/snapshot/<domain> otherwise. Every admin action in GoAdmio has a matching /go/ command, so anything you can click you can also script.

Quick start

# Back up one account
/go/snapshot example.com

# List its snapshots
/go/snapshot example.com list

# Restore everything from a date
/go/snapshot example.com restore 2026-11-18

Options

Option Applies to Notes
--www restore Restores only /home/<domain>/www and recreates subdomains.
--mail restore Restores only /home/<domain>/mail and recreates the mailboxes.
--database restore Restores only the account’s log folder (dumps and saved settings) and re-creates the MySQL/MariaDB and PostgreSQL databases.
--skip mysql restore Creates the MySQL/MariaDB database records but doesn’t import the dumps. It has no effect on backups.
--list Any domain Prints `short-id

--www, --mail, and --database can be combined. With none of them, restore restores everything.

Examples

# Back up everything that has snapshots enabled
/go/snapshot all

# Back up one account, then check
/go/snapshot example.com
/go/snapshot example.com list

# Machine-readable list: short-id|tag|unix-time
/go/snapshot example.com --list

# Restore only the website files, from a date
/go/snapshot example.com restore 2026-11-18 --www

# Restore only the databases, from a snapshot ID
/go/snapshot example.com restore 3f9a1c2b --database

# Restore mail but don't import MySQL dumps
/go/snapshot example.com restore 2026-11-18 --mail --skip mysql

# Restore one folder
/go/snapshot /home/example.com/www/uploads 2026-11-18

# Restore one database dump
/go/snapshot /home/example.com/log/mysql/example_db.sql 2026-11-18

# Restore one mailbox folder
/go/snapshot info@example.com 2026-11-18

# Delete all snapshots of one account
/go/snapshot example.com delete

Output

Outcome What you get
Backup of all accounts [N/C] Snapshot Backup <domain>... for each account, then restic’s output.
Backup of one account Creating Snapshot: <repository>..., then restic’s output.
Missing repository Repository Missing: <repository>, System will Initialize new Repository.
Another run in progress Instance (<name>) already running. and exit code 1.
Domain not found Domain <domain> does not exist, or User <user> does not exist on cPanel.
Unknown account SNAPSHOT: Domain Directory /home/<name> not Exists.
Unknown archive Archive <archive> does not exist, followed by the repository’s snapshot list.
Restore Restoring Snapshot TAG <archive>... or Restoring Snapshot ID <archive>..., then a section for subdomains, mail, MySQL/MariaDB, and PostgreSQL.

Exit codes

Backups finish normally. These modes always exit with code 1, even on success: list, restoring a single dump, a path, or a mailbox, and --list.

Logging

Every run is appended to /var/log/go/snapshot.log.

Locking

Full runs (all, no argument, check, and cPanel usernames) take the lock file /usr/local/goadmio/lock/backup.lock, which is shared with backup. A lock younger than one hour blocks a second run. An older lock is treated as stale and replaced. Runs for a single domain, path, or mailbox don’t take the lock.

Security

[!WARNING]
Every repository is encrypted with the same fixed password, GoPanel. Anyone who can read the repository files, for example on the remote storage, can open every snapshot. Snapshots contain site files, database dumps, MariaDB password hashes, PostgreSQL passwords in plain text, and a saved password line (see Notes for maintainers).

The MariaDB root password is also passed on the command line during dumps, so it can be visible in the process list.

See the full reference at /go/snapshot and the GoAdmio command index.

GoAdmio is free and open source, with no license fees and no account limits. Read the GoAdmio docs, or see why it is a free cPanel alternative at goadmio.com.

By:

Posted in:


Leave a Reply

Your email address will not be published. Required fields are marked *