GoAdmio

backup

Back up one or all GoAdmio accounts to local disk or remote storage, manually or on a schedule

On this page: Overview · Quick start · Syntax · Options · Output · Examples · Troubleshooting · Details · See also


Overview

/go/backup is GoAdmio's backup tool. It can:

A full account backup contains the site files, mail, database dumps, and the account settings needed to recreate the account. Restore it with restore.

The command re-runs itself with sudo when started by a non-root user, and appends every call to /var/log/go/backup.log.


Quick start

# Back up one account into /backup
/go/backup example.com

# Back up every account into /backup
/go/backup all

# Run the scheduled backup now (uses the saved primary destination)
/go/backup

Syntax

# Positional forms
/go/backup <domain>
/go/backup all
/go/backup all <RemoteIP> <RemotePass>
/go/backup [secondary|tertiary]
/go/backup default [30]
/go/backup ssl
/go/backup go
/go/backup <source-folder> <remote-folder>

# Option form
/go/backup --domain <domain|all> [options]
/go/backup --setup 1 --destination <destination> [options]
Form Behavior
/go/backup <domain> Full backup of one account, moved to /backup.
/go/backup all Runs the single-account form above for every account that has a www folder.
/go/backup all <RemoteIP> <RemotePass> Legacy form. Full backup of every account over SFTP to /backup on the remote server, as root on port 22. Any three positional arguments are read this way; the first is ignored.
/go/backup Scheduled run using the saved primary destination (/var/go/etc/backup.conf).
/go/backup secondary Scheduled run using the secondary destination.
/go/backup tertiary Scheduled run using the tertiary destination.
/go/backup default Saves a preset: full backup to an rclone remote (keep 8) and a database-only copy as secondary.
/go/backup default 30 Same, but over SFTP and keeping 33 backups. The server and password are placeholders (-); edit them afterwards.
/go/backup ssl Copies Let's Encrypt live and archive folders to /var/go/ssl/ so they are included in primary backups.
/go/backup go Copies /root/*.sh to /GoAdmio and runs the IDrive backup.
/go/backup <source> <remote> Copies a folder to the primary remote with rclone copy. Both arguments must contain /. Not available when the primary destination is local.
/go/backup --help Prints usage and exits.

Any argument that contains -- switches the command to option form. An unrecognized option stops it with BACKUP: Unknown parameter: <option>. Option names are lowercase.

[!NOTE] Most modes exit with status 1 even when they succeed. Don't chain /go/backup with &&; check the output or the notifications instead.


Options

A "—" in the Default column means the option is empty or unset unless you pass it. Passing --domain without --setup 1 runs a backup; passing --setup 1 saves a destination instead.

Main options

Group Option Default Notes
Selection --domain — An account domain, or all.
Selection --type full See Backup types.
Selection --date Today (YYYY-MM-DD) Used in archive and folder names.
Selection --storage backup Destination slot: backup (primary), secondary, or tertiary.
Destination --destination — See Destinations.
Destination --remotedir / Target folder. For rclone remotes, leading slashes are removed (use bucket/path for S3).
Destination --remoteserver — Host for ftp and sftp.
Destination --remoteuser root User for ftp and sftp.
Destination --remotepass — Password for ftp, sftp, internxt, and linkbox.
Destination --port — Port for ftp and sftp.
Schedule --setup — 1 saves the destination and installs the cron job instead of backing up.
Schedule --cron — Stored in the destination file and read by cron.
Schedule --retention — Number of dated backup folders to keep on the remote.
Schedule --sync — 1 also takes a MariaDB hot backup (mariadb-backup) and uploads it.
Schedule --quiet — 1 hides the setup messages and the SFTP connection test.

Provider options

These are used with --setup 1 to create the rclone remote for the chosen destination.

Destination Options
ftp, sftp --remoteserver, --remoteuser, --remotepass, --port
s3 --accesskeyid, --secretaccesskey, --endpoint, --provider, --region
azureblob --account, --key
azurefiles --account, --sharename, --key
webdav --url, --vendor, --webdavuser, --webdavpass
mega --megauser, --megapass
protondrive --protondriveuser, --protondrivepass
pikpak --pikpakuser, --pikpakpass
opendrive --opendriveuser, --opendrivepass
mailru --mailruuser, --mailrupass
ulozto --apptoken, --uloztouser, --uloztopass
internxt --email, --remotepass
linkbox --token, --email, --remotepass
fichier --apikey
drime, gofile --accesstoken
idrive None. Configure the IDrive client by hand (see Details).

--idriveuser and --idrivepass are accepted and stored but not used by this command.

Backup types

Type Archive contains
full www, mail, etc, log, sqlite
www www, etc, log
mail mail, etc, log
database etc, log, sqlite
wwwmail www, mail, etc, log
wwwdatabase www, etc, log, sqlite
maildatabase mail, etc, log, sqlite

Database dumps are written into log/mysql and log/postgre before archiving, so any type that includes database (and full) contains them. An empty --type means full; any other value stops with Invalid backup type: <type>.

Destinations

Destination Where each account archive goes
homedir Stays in /home/<domain>/.
url Moved to /usr/local/goadmio/backup/ with a random 16-character suffix in the file name.
backup Moved to /backup/.
local Moved to --remotedir.
sftp Uploaded with rsync over SSH (sshpass) to --remoteuser@--remoteserver:--remotedir.
idrive Moved to /backup/idrive/<date>/, then uploaded by the IDrive client.
Any other value Copied with rclone copy to the rclone remote named by --storage. Use rclone for a remote you created yourself.

The archive is named <type>-backup-<date>-<domain>.tar.gz, with a top-level folder of the same name inside.


Output

The command prints plain-text progress, one block per account:

[3/42] Transferring example.com full Backup to backup:backup/web1/2026-11-19 | Compressing...

Scheduled runs also send an email and a WhatsApp message at these points:

Event Message
Run starts Schedule Backup Running Now
Run finishes Schedule Backup Finished (Copied: <n> Sites)
Remote unreachable Schedule Backup Failed with Connection Failed (<server>)
Local destination, root disk 90% full or more Your disk space is running low (the run stops)

<n> counts every account the run looked at, including accounts with backups disabled.

Security

[!WARNING] Backup files and settings contain credentials. Treat them as sensitive.


Examples

# Full backup of one account into /backup
/go/backup example.com
# Files and databases only, leave the archive in the account's home folder
/go/backup --domain example.com --type wwwdatabase --destination homedir
# Save an SFTP destination as primary: full backups, keep 8, include MariaDB hot backup
/go/backup --setup 1 --cron "" --type full --destination sftp \
  --remoteserver 203.0.113.10 --remoteuser root --remotepass 'S3cureP@ss' --port 22 \
  --remotedir /backup --retention 8 --sync 1
# Save an S3 destination as secondary: database only, keep 8, no hot backup
/go/backup --setup 1 --cron "" --storage secondary --type database --destination s3 \
  --accesskeyid <key-id> --secretaccesskey <secret> --endpoint s3.example.com \
  --provider Other --region us-east-1 \
  --remotedir my-bucket/backups --retention 8 --sync 0
# Run the scheduled backups now
/go/backup
/go/backup secondary
# Copy a folder to the primary remote
/go/backup /root/home /backup/home

Troubleshooting

Symptom Likely cause Fix
Instance (backup) already running. Another run holds the lock and it was updated in the last 30 minutes. Wait for it to finish. If it is stale, delete /usr/local/goadmio/lock/backup.lock.
BACKUP: Unknown parameter: <option> Misspelled option, or capital letters in the name. Check Options.
Invalid backup type: <type> Type isn't in the list. Use one of the backup types.
BACKUP: Domain Directory /home/<domain> not exists. The account doesn't exist on this server. Check the domain spelling.
File /var/go/etc/<storage>.conf not exists. No destination has been saved for this slot. Run with --setup 1, or /go/backup default.
[<storage>] Mot Exists. No rclone remote with that name in /root/.config/rclone/rclone.conf. Run --setup 1 again for that --storage.
Your disk space is running low. Local destination and root disk at 90% or more. The run stops. Free space, or switch to a remote destination.
Please enter your remote server SFTP setup still has the - placeholder. Pass a real --remoteserver.
Can not copy folder <path>. Please Setup Remote Server Backup. Folder copy while the primary destination is local. Set up a remote destination first.
[n/total] Backup Disabled <domain> Backups are turned off for that account. Enable backups for the account.
[n/total] /home/<domain>/www not exists The account has no www folder. Check the account.
Single-account backup fails to move the archive /backup doesn't exist. This form doesn't create it. Create /backup.
Exit status is 1 after a good run Most modes exit with 1. Check the output or notifications.

Details

Mode selection

flowchart TD
    A["backup ..."] --> B{"Any -- options?"}
    B -- "No" --> M{"Positional form"}
    M -- "go, all, ssl, default, folder copy" --> H["Helper mode, then exit"]
    M -- "none, secondary, tertiary" --> S["Scheduled run"]
    M -- "domain" --> L["Local full backup"]
    B -- "Yes" --> U{"--setup 1?"}
    U -- "Yes" --> SV["Save destination, create rclone remote, run cron"]
    U -- "No" --> D{"--domain all?"}
    D -- "Yes" --> LOOP["Each account with backups enabled"]
    D -- "No" --> ONE["One account"]
    S --> LOOP
    L --> ONE
    LOOP --> ONE
    ONE --> OUT["Archive sent to the destination"]

Scheduled run

/go/backup, secondary, and tertiary read /var/go/etc/<storage>.conf. Only one scheduled run can hold the lock at a time (see Troubleshooting). A run:

  1. Copies GoAdmio's SQLite databases (/var/lib/sqlite/*.db) to /var/lib/sqlite/backup/<date>.
  2. Sends the Schedule Backup Running Now notification.
  3. If --sync 1, takes a compressed MariaDB hot backup into /mysql, using half the CPU threads (at least 1).
  4. Delivers by destination:
    • local: stops if the root disk is at 90% or more, otherwise creates <remotedir>/<hostname>/<date> and backs up every account into it.
    • idrive: copies the SQLite databases and /var/go to /backup/idrive/<date>, runs the IDrive client, then backs up every account.
    • everything else (rclone remotes): prunes old backups, uploads the extras below, deletes /mysql, then backs up every account.
  5. Backs up every account that has backups enabled, updates its backup timestamp, and sends the finished notification.

For an rclone remote, the run keeps this layout:

<remotedir>/<hostname>/<date>/
├── <type>-backup-<date>-<domain>.tar.gz   one per account
├── mysql/                                  with --sync 1
├── var/go/                                 primary storage only
└── var/lib/sqlite/                         primary storage only

Retention. Before uploading, if the number of dated folders under <remotedir>/<hostname> is at least --retention, the oldest is deleted. The check runs twice per run, so up to two old folders can be removed.

Single-account backup

Each account goes through these steps:

  1. Validates the type and checks that /home/<domain> exists.
  2. Deletes /home/<domain>/log, any previous archive, and older url archives for the account, then recreates etc and log.
  3. For types that include www, writes the account's subdomain settings.
  4. Writes the account settings (site.conf, read by create in restore mode) and the account's Linux password line.
  5. For full and database types, dumps MariaDB (mariadb-dump) and PostgreSQL (pg_dump) databases and saves each database user's credentials.
  6. For full and mail types, writes the mail settings if /home/<domain>/mail exists.
  7. Creates the archive and removes the helper folders from log.
  8. Delivers it to the destination.

[!WARNING] Step 2 deletes the account's log folder on every backup. Anything else stored there is lost.

Saving a destination

--setup 1 writes every setting to /var/go/etc/<storage>.conf, then creates the rclone remote named after the slot:

Destination Remote created
local None; any existing remote for the slot is deleted.
ftp, sftp Host, user, port, and obscured password.
s3, azureblob, azurefiles, webdav, mega, protondrive, pikpak, opendrive, mailru, ulozto, internxt, linkbox, fichier, drime, gofile Built from the provider options.
idrive None (see below).
rclone None; create the remote yourself with rclone config.

For sftp, unless --quiet 1 is given, it uploads a test file to check the connection and prints Setup Completed Successfully or the error. It then runs cron to install the schedule.

IDrive

--destination idrive creates /backup/idrive, removes IDrive's cron entries, and prints a reminder: run /opt/IDriveForLinux/bin/idrive, choose Edit your Backupset, and set the source to /backup/idrive. Install the client first with installidrive.

Requirements

Tool Needed for
pv Installed automatically with dnf or apt if missing.
rsync, sshpass sftp account uploads.
rclone All remotes other than sftp account uploads, retention, and folder copy.
mariadb-backup --sync 1.
IDrive for Linux idrive destination and /go/backup go.

See also

Command Description
restore Restore a GoAdmio backup from the command line
recover Restore a deleted account from its latest snapshot
snapshot Restic-based per-domain snapshot backup and restore
cb Copy GoAdmio backups from the local server to a remote server
cf Copy all files from a source folder to a destination folder
cron Set up main cron jobs in GoAdmio
maria Incremental MariaDB backup to S3 or via Rclone
mysqlbackup Back up MariaDB/MySQL to a remote server via rsync
serversync Back up and migrate a GoAdmio server with all configurations
installidrive Install the IDrive for Linux client
create Create a GoAdmio account from the command line