summaryrefslogtreecommitdiff
path: root/src/backup_run.rs
AgeCommit message (Collapse)AuthorFilesLines
2021-12-31docs: add documentation comments to crateLars Wirzenius1-0/+26
Also, make it an error for a public symbol to not be documented. Sponsored-by: author
2021-11-27feat! turn errors from backup root directory into errorsLars Wirzenius1-2/+9
Previously an error from, say, a missing backup root directory was reported to the user as a warning. Turn it into an error. However, errors reading a file or directory inside the backup root should still be just a warning. Sponsored-by: author
2021-08-27Drop struct field which is always 0Alexander Batischev1-2/+0
2021-08-16refactor: rename function to have a clearer nameLars Wirzenius1-13/+8
Rename `read_file` to `upload_regular_file` to better describe the purpose of the function. Sponsored-by: author
2021-08-16refactor: move file reading, etc, for backups to backup_runLars Wirzenius1-6/+103
Move code to read a file as chunks during a backup, and upload any new chunks to the chunk server, into `src/backup_run.rs`. Previously they were mostly in `src/client.rs`, which is meant to provide an abstraction for using the chunk server API. Sponsored-by: author
2021-08-16refactor: rename function for clarityLars Wirzenius1-2/+2
Sponsored-by: author
2021-08-16refactor for clarityLars Wirzenius1-30/+30
Sponsored-by: author
2021-08-16refactor: for clarityLars Wirzenius1-4/+4
Sponsored-by: author
2021-08-09refactor: for simplicityLars Wirzenius1-13/+4
Sponsored-by: author
2021-08-09refactor: split long func into twoLars Wirzenius1-28/+65
Sponsored-by: author
2021-08-09refactor: use async for "obnam backup"Lars Wirzenius1-21/+20
This changes things so that "obnam backup" uses async for everything. The old non-async BackupClient and ChunkClient are dropped. This does NOT move the chunking, and checksum computation, to its own function. This will happen later. Sponsored-by: author
2021-08-09refactor: use for loop over an iterator instead of .insert_iterLars Wirzenius1-53/+66
This makes the code more explicit, which is good for now, and is a step towards making it all use async. There will be a need to refactor this further with better abstractions, once async works. Sponsored-by: author
2021-08-04Merge branch 'bugfix/overlapping-progress-bars' into 'main'Lars Wirzenius1-8/+17
fix: do not overlap "download" and "incremental" progress bars See merge request obnam/obnam!172
2021-08-03fix: do not overlap "download" and "incremental" progress barsAlexander Batischev1-8/+17
The problem is the same as #101, except this time it affected a different set of progress bars. It was introduced in e6147a3b7b58b151fb7ad9b1f748e0a666f271de. This commit postpones the creation of "incremental" progress bar until after we've fetched the previous generation. This avoids showing both progress bars at once.
2021-08-01refactor: add a type alias for generation idsLars Wirzenius1-3/+5
This will make it harder to accidentally use a string. Can still be confused with a chunk id. Sponsored-by: author
2021-07-30cleanup: fix things rustc/clipppy now complain aboutLars Wirzenius1-5/+5
Mostly https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow. Sponsored-by: author
2021-07-28Store backup_roots() outcome in a structAlexander Batischev1-7/+20
2021-07-28After the backup, print out a list of new CACHEDIR.TAGsAlexander Batischev1-4/+15
2021-07-28FsIter: annotate entries belonging to CACHEDIR.TAGsAlexander Batischev1-16/+13
2021-07-28Mark CACHEDIR.TAGs in the databaseAlexander Batischev1-1/+12
In the following commits, we'll use this to check if a tag existed before.
2021-07-21Replace FsIterResult with plain ResultAlexander Batischev1-2/+2
2021-07-21backup_run: replace tuple with a structAlexander Batischev1-5/+21
2021-07-21Replace BackupResult with plain ResultAlexander Batischev1-5/+6
2021-07-05refactor: code to run backups to have less repetitionLars Wirzenius1-70/+56
This should make it easier to introduce async, later.
2021-05-29refactor: only have client config without passwordsLars Wirzenius1-2/+0
This means the config is always the config, and not sometimes the config or the config and passwords. Also, there's no config option for encrypting, anymore. It will not be optional now.
2021-04-26Port chunkids() to the iterator APIAlexander Batischev1-1/+5
2021-04-10refactor: move ClientConfig into its own moduleLars Wirzenius1-1/+2
2021-04-09feat: add "obnam init" subcommandLars Wirzenius1-0/+2
This reads a passphrase and derives two passwords from that, and stores them next to the configuration file. The passwords aren't yet used for anything, that will come later.
2021-03-27refactor: rename BackupPoliy::new() to more idiomatic ::default()Lars Wirzenius1-1/+1
2021-03-27refactor: don't return a Result from function that can't failLars Wirzenius1-7/+17
2021-03-27refactor: drop unnecessary cloneLars Wirzenius1-1/+1
2021-03-27refactor: drop unnecessary referenceLars Wirzenius1-1/+1
2021-02-23feat: have separate progress bar for each backup phaseLars Wirzenius1-9/+41
2021-02-19feat: back up and restore Unix domain socketsLars Wirzenius1-1/+5
2021-02-16refactor: split BackupRun into initial, incremental variantsLars Wirzenius1-13/+33
This is clearer, easier to modify than having a flag to indicate which variant we're running.
2021-02-16refactor: split BackupProgress into initial, increemental variantsLars Wirzenius1-1/+1
This makes it possible to later have different progress bars for initial and incremental backup runs. However, for now the bars are identical.
2021-02-07feat: if file can't be read, log that, don't end backup in errorLars Wirzenius1-9/+21
Such files won't be restored, as they'd be restored as empty file, and that would be confusing and thus bad.
2021-02-07refactor: rename Reason::Error to Reason::GenerationLookupErrorLars Wirzenius1-1/+4
New name is more precise. The meaning of the enum variant hasn't changed.
2021-02-07feat: add catch-all Reason variant for unknown reasonLars Wirzenius1-1/+1
Just in case the SQLite DB stores a reason this version of Obnam doesn't understand, we handle that now.
2021-02-06feat: use the chunk size setting from the client configurationLars Wirzenius1-2/+2
Use the chunk_size setting for file data. For the SQLite file, use a hard-coded size instead.
2021-02-06feat: client verifies server's TLS certificate by defaultLars Wirzenius1-1/+1
Configuration setting can disable it.
2021-02-04refactor: have per-module error enumsLars Wirzenius1-8/+23
This means that a function that parses step bindings can't return an error that the document is missing a title. Such an error return would be nonsensical, and we use the Rust type system to prevent it, at a small cost of being a bit verbose. Additional benefit is that the library portion of Obnam doesn't return anyhow::Result values anymore.
2021-01-05refactor: move policy on whether to back up a file into a moduleLars Wirzenius1-0/+92
This commit also splits up the src/cmd/backup.rs module into other, smaller, more cohesive modules that are easier to understand and use.