Added File remote backups

+ Copies the backup to a target directory
+ Useful for backing up to another local drive or mounted network drive
+ Various improvements
+ Fixed .drone.yml
This commit is contained in:
2021-09-19 13:56:30 -06:00
parent d207c6df19
commit 8378f2ead3
12 changed files with 70 additions and 66 deletions
+5 -5
View File
@@ -9,13 +9,13 @@ pub mod ftp;
pub mod sftp;
pub trait RemoteBackupFile {
/// Type containing the location of the remote backup
/// Type containing the location of the remote_backup backup
type LocationType;
/// Get the underlying location type
fn location(&self) -> Self::LocationType;
/// Get the time the remote file was created
/// Get the time the remote_backup file was created
fn time_created(&self) -> chrono::NaiveDateTime;
/// Parse the time created from the file name
@@ -34,10 +34,10 @@ pub trait RemoteBackupSite {
/// Struct representing the location of a backup on the site
type FileType: RemoteBackupFile;
/// Backup a file to the the remote site
/// Backup a file to the the remote_backup site
fn backup_to_remote(&mut self, file: PathBuf) -> Result<()>;
/// Get the locations backups contained on the remote site
/// Get the locations backups contained on the remote_backup site
fn get_backups(&mut self) -> Result<Vec<Self::FileType>>;
/// Remove a backup from the side
@@ -46,7 +46,7 @@ pub trait RemoteBackupSite {
/// Number of backups to keep on the site
fn backups_to_keep(&self) -> usize;
/// Cleanup old backups on the remote site
/// Cleanup old backups on the remote_backup site
fn cleanup(&mut self) -> Result<usize> {
let mut backups = self.get_backups()?;