Skip to main content

tuwunel_admin/server/
backup_database.rs

1use tuwunel_core::Result;
2
3use crate::admin_command;
4
5#[admin_command]
6pub(super) async fn backup_database(&self) -> Result {
7	let count = self
8		.blocking_db(|db| {
9			db.engine.backup()?;
10			db.engine.backup_count()
11		})
12		.await?;
13
14	write!(self, "Done. Currently have {count} backups.").await
15}