summaryrefslogtreecommitdiff
path: root/src/backup_run.rs
AgeCommit message (Collapse)AuthorFilesLines
2022-10-26use new chunk store for all of client.rsLars Wirzenius1-11/+14
Sponsored-by: author
2022-07-17chore: make code more idiomatic, based on clippy warningsLars Wirzenius1-3/+1
Sponsored-by: author
2022-04-16feat: use one checksum for all chunks in a backupLars Wirzenius1-3/+19
When making a backup, use the same checksum for any chunks it re-uses or creates. This is for performance: if we allowed two checksums to be used, we would have to compute the checksum for a chunk twice, and potentially look up both on the server. This is just a lot of work. Instead, we use only one. The trade-off here is that when (not if) the user wants to switch to a new checksum type, they'll have to do a full backup, uploading all their data to the server, even when it's already there, just with a different checksum. Hopefully this will be rare. Full backups always use the built-in, hardcoded default checksum, and incremental backups use whatever the previous backup used. The default is still SHA256, but this commit add code to support BLAKE2 if we decide to switch that as a default. It's also easy to add support for others, now. BLAKE2 was added to verify that Obnam can actually handle the checksum changing (manual test: not in the test suite). I don't think users need to be offered even the option of choosing a checksum algorithm to use. When one cares about both security and performance, choosing a checksum requires specialist, expert knowledge. Obnam developers should choose the default. Giving users a knob they can twiddle just makes it that much harder to configure and use Obnam. If the choice Obnam developers have made is shown to be sub-optimal, it seems better to change the default for everyone, rather than hope that every user changes their configuration to gain the benefit. Experience has shown that people mostly don't change the default configuration, and that they are especially bad at choosing well when security is a concern. (Obnam is free software. Expert users can choose their checksum by changing the source code. I'm not fundamentally limiting anyone's freedom or choice here.) Users can switch to a new default algorithm by triggering a full backup with the new "obnam backup --full". Sponsored-by: author
2022-04-05feat: collect and log some time metricsLars Wirzenius1-0/+7
Log the complete run-time of the program, and the time spent downloading the previous generation, and uploading the new generation. Sponsored-by: author
2022-03-22feat! drop generation related fields from chunk metadataLars Wirzenius1-1/+1
Sponsored-by: author
2022-03-22feat! store list of generations in a "client trust root" chunkLars Wirzenius1-1/+2
Backups made with this version can't be restored with old clients, and vice version. Sponsored-by: author
2022-03-20feat: allow user to choose backup schema version for new backupsLars Wirzenius1-3/+6
The way this is currently implemented resulted in a lot of code duplication in src/generation.rs. This should be refactored later. My first attempt to do it by adding a trait for a schema variant failed. Sponsored-by: author
2022-03-06refactor: use new database abstraction for generationsLars Wirzenius1-2/+9
Sponsored-by: author
2022-03-03refactor: use FileId instead of raw typeLars Wirzenius1-1/+2
This is clearer and less error prone. Sponsored-by: author
2022-01-19Merge branch 'skipped-fix' into 'main'Lars Wirzenius1-6/+8
fix: if a file is skipped, don't include it in the new backup Closes #177 See merge request obnam/obnam!213
2022-01-19fix: if a file is skipped, don't include it in the new backupLars Wirzenius1-6/+8
Sponsored-by: author
2022-01-19refactor: rename AsyncBackupClient to just BackupClientLars Wirzenius1-7/+4
There is only async. Sponsored-by: author
2022-01-16refactor: rename Chunker to FileChunksLars Wirzenius1-2/+2
This should make it a little clearer that it can act as an iterator. Sponsored-by: author
2022-01-16refactor: rename AsyncBackupClient to just BackupClientLars Wirzenius1-7/+4
There is only async. Sponsored-by: author
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.