Skip to content

Commit

Permalink
start with archive
Browse files Browse the repository at this point in the history
  • Loading branch information
tiptenbrink committed May 3, 2024
1 parent 2ffb5ba commit 7fcfa53
Show file tree
Hide file tree
Showing 4 changed files with 102 additions and 3 deletions.
88 changes: 86 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ color-eyre = "=0.6.3"
test-log = { version="=0.2.15", default-features = false, features = ["trace"] }
duct = "=0.13.7"
camino = "1.1.6"
once_cell = "1.19.0"
once_cell = "1.19.0"
tar = "0.4.40"
flate2 = "1.0.30"
12 changes: 12 additions & 0 deletions src/next/archives.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
use std::fs::File;
use flate2::Compression;
use flate2::write::GzEncoder;

fn archive() -> Result<(), ArchiveError> {
let tar_gz = File::create("archive.tar.gz")?;
let enc = GzEncoder::new(tar_gz, Compression::default());
let mut tar = tar::Builder::new(enc);
tar.append_dir_all("backup/logs", "/var/log")?;
let a = tar.into_inner();
Ok(())
}
1 change: 1 addition & 0 deletions src/next/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ pub(crate) mod resolve;
pub(crate) mod run;
pub(crate) mod secrets;
pub(crate) mod state;
pub(crate) mod archives;

0 comments on commit 7fcfa53

Please sign in to comment.