/backups/remote/test
0.1.0Unchanged since publicationTest the remote backup destination
backupsallUrbeStack creates its SSH key pair if needed and uses it to connect to backups.remote_host on backups.remote_port as backups.remote_user. It creates backups.remote_path and any missing parent directories, then lists the destination's contents, including backup day folders. The response contains the test result in remote.
On the first connection, UrbeStack records the SSH host key in known_hosts and reports its fingerprint. Future transfers require the recorded key. If the test reports a changed host key, verify the change, run urbestack-backup-remote-key with --forget-host, and test again.
The API returns 400 if backups.remote_host, backups.remote_user or backups.remote_path is unset, and 403 if the caller lacks administrator privileges. It returns 502 if the host key has changed, the host does not respond, the remote account rejects UrbeStack's key, or the remote host lacks rsync. The error includes the SSH failure or installation instructions as applicable. Nightly transfers use rsync on both hosts. Configure the destination through PUT /settings/{key}.
As a command
Run as root on the serverExample
See the API overview for how to set $API and $TOKEN.curl -sS -X POST "$API/backups/remote/test" \ -H "Authorization: Bearer $TOKEN"
200 OK{
"remote": {
"days": [
"text"
],
"entries": 1,
"fingerprint": "text",
"free_bytes": 1,
"host": "text",
"host_key": {
"fingerprint": "text",
"name": "alice",
"type": "rebuild"
},
"path": "public_html/index.php",
"port": 8443,
"size_bytes": 1,
"user": "alice"
}
}Errors
3 errors, each a status and a sentence400Name the remote host, user and path first401Authentication required403Insufficient privilegesurbestack.com/docs/api/post-backups-remote-test/