backup Create an archive
No arguments runs a standard backup. Add a comment with -c.
Timestamped archives, named restore points, and version-aware rollback — all from a single portable shell script. No daemon, no agent.
root@openvpnas2: ~
Built for production Access Server hosts. Adds no service to maintain — just a script, optionally wired into systemd or cron.
Every archive carries the Access Server version, a Unix timestamp, and an optional comment — surfaced in --list and matched on restore.
Drops into /usr/local/bin. Runs with the shell and utilities already on the host.
Reads as.conf and exports SQLite or MySQL with the matching toolchain.
Installer detects systemd timers first; falls back to cron when systemd is absent.
Stops openvpnas before restoring, warns on version mismatch, and never deletes archives.
Create backups with optional comments, list archives for audits, and restore by the timestamp ID printed in --list.
All output is parseable. Pass --no-header to --list for scripts.
No arguments runs a standard backup. Add a comment with -c.
Print all backups, suppress headers for scripts, or filter to one AS version.
Pass the timestamp ID from the first column. The script stops Access Server, restores, and starts it back up.
Override defaults when running the script or via systemd unit / cron environment.
| Variable | Default | Required | Purpose |
|---|---|---|---|
| BACKUP_ROOT | /usr/local/openvpn_as/etc/backup | no | Archive destination root. |
| AS_CONF | /usr/local/openvpn_as/etc/as.conf | no | Access Server configuration file. |
| DB_DIR | /usr/local/openvpn_as/etc/db | no | Local SQLite database directory. |
The installer drops the script into /usr/local/bin,
picks systemd or cron based on what's available, and schedules nightly backups at 03:00 local time.
Expects normal Access Server host conditions. Everything except mysqldump
and mysql ships on a default AS install.