summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)AuthorFilesLines
2022-01-01chore: drop unused fsentry::ErrorAlexander Batischev1-8/+0
This type was superceded by fsentry::FsEntryError in a2adcb5a90c15b473a2fcf114555443fba8a20ce. Fixes #183.
2021-12-31feat: compare schema versions for compatibilityLars Wirzenius1-1/+63
When opening a local generation, check that it's compatible with the current version of Obnam. Sponsored-by: author
2021-12-31docs: add documentation comments to crateLars Wirzenius39-17/+508
Also, make it an error for a public symbol to not be documented. Sponsored-by: author
2021-12-05chore: drop unused fields in struct IndexLars Wirzenius1-13/+2
At this point, I don't know why the fields were there, but they are now not used at all, so they can be dropped. Sponsored-by: author
2021-12-05chore: tidy up things found by newer Rust toolchainLars Wirzenius3-26/+9
Sponsored-by: author
2021-11-27feat! turn errors from backup root directory into errorsLars Wirzenius2-2/+12
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-11-20chore: bump dependency on rusqlite to 0.26.1 and fix breakageLars Wirzenius2-9/+9
Sponsored-by: author
2021-11-20chore: update dependency on pbkdf2 to 0.9 and fix breakageLars Wirzenius1-1/+1
Sponsored-by: author
2021-10-24feat! store schema version of generation database in the dbLars Wirzenius4-0/+155
Add a new mandatory database table "meta" to the SQLite database the stores information about the files in a backup generation. The idea is for future versions of the Obnam client to be able to be able to restore from backups made by older -- or newer -- versions of Obnam, as far as is reasonable. Add the `obnam gen-info` command to show information about the generation metadata. Sponsored-by: author
2021-10-10chore: drop debug eprintln! callsLars Wirzenius1-2/+0
They're not useful now. Should probably add logging, but that will have to wait until we have a good logging story. Sponsored-by: author
2021-09-23drop: benchmark programsLars Wirzenius4-242/+0
I think we need to re-think the way we do benchmarks. These old programs aren't useful anymore. We definitely want to run benchmarks via "cargo bench" rather than having extra binaries in the crate. Sponsored-by: author
2021-09-18refactor: define a Checksum type and use it where appropriateLars Wirzenius9-30/+72
This will make it harder to compare, say, a SHA-256 and a SHA3, later, when we add more checksum types. 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 Wirzenius3-103/+108
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 Wirzenius2-17/+4
Sponsored-by: author
2021-08-09refactor: split long func into twoLars Wirzenius2-28/+69
Sponsored-by: author
2021-08-09refactor: use async for "obnam backup"Lars Wirzenius3-229/+89
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: drop NascentGeneration::insert_iterLars Wirzenius1-31/+12
It was only used by a test function, which is now changed to not use it. Add comment to the test function that it's too complicated and things need refactoring. However, that probably needs to wait for new abstractions. Sponsored-by: author
2021-08-09refactor: use for loop over an iterator instead of .insert_iterLars Wirzenius2-56/+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-09refactor: call NascentGeneration::insert from ::insert_iterLars Wirzenius1-4/+1
This is a step towards getting rid of insert_iter entirely, which would make it easier to make `obnam backup` use async. I originally split insert_iter so I could use a single transaction for inserting many rows, but it seems to not be needed for speed after all. I've benchmarked backing up a large file with and without this change, and there's no real difference. I've not benchmarked with a large number of files. Even if there's a performance hit from using multiple transactions, my hope is that by being able to use more CPUs/threads for backing up will outweigh that by far. Sponsored-by: author
2021-08-09Fix compilation on MacOSOssi Herrala2-2/+7
For chmod() we need to cast mode parameter from u32 to u16 because MacOS has 16 bit mode_t while Linux is using 32 bits.
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-02Merge branch 'feature/117-obnam_server_log' into 'main'Lars Wirzenius1-1/+1
feat: configure log verbosity with OBNAM_SERVER_LOG envvar Closes #117 See merge request obnam/obnam!170
2021-08-01refactor: use a struct for GenIdLars Wirzenius5-13/+36
This means a ChunkId can't be used instead. Sponsored-by: author
2021-08-01refactor: add a type alias for generation idsLars Wirzenius8-19/+23
This will make it harder to accidentally use a string. Can still be confused with a chunk id. Sponsored-by: author
2021-08-01feat: add command to resolve a generation ref into a chunk idLars Wirzenius3-0/+37
Sponsored-by: author
2021-07-31feat: configure log verbosity with OBNAM_SERVER_LOG envvarAlexander Batischev1-1/+1
Fixes #117.
2021-07-30cleanup: fix things rustc/clipppy now complain aboutLars Wirzenius9-19/+19
Mostly https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrow. Sponsored-by: author
2021-07-28Backup: exit non-zero if new tags are foundAlexander Batischev2-2/+11
2021-07-28Store backup_roots() outcome in a structAlexander Batischev2-12/+30
2021-07-28After the backup, print out a list of new CACHEDIR.TAGsAlexander Batischev2-7/+26
2021-07-28FsIter: annotate entries belonging to CACHEDIR.TAGsAlexander Batischev2-23/+31
2021-07-28Mark CACHEDIR.TAGs in the databaseAlexander Batischev2-24/+126
In the following commits, we'll use this to check if a tag existed before.
2021-07-23refactor: async for "obnam show-generation"Lars Wirzenius1-5/+10
Sponsored-by: author
2021-07-23refactor: use async for "obnam restore"Lars Wirzenius1-18/+27
Sponsored-by: author
2021-07-23refactor: use async for "obnam list-files"Lars Wirzenius2-4/+39
Sponsored-by: author
2021-07-23refactor: use async for "obnam list"Lars Wirzenius2-3/+26
Sponsored-by: author
2021-07-23refactor: use async for "obnam get-chunk"Lars Wirzenius2-4/+123
Sponsored-by: author
2021-07-22Merge branch 'feature/114-replace-string-with-chunkid' into 'main'Lars Wirzenius2-4/+6
In errors, store chunk ids as `ChunkId`, not `String` Closes #114 See merge request obnam/obnam!165
2021-07-21Replace StoreResult with plain ResultAlexander Batischev1-6/+3
2021-07-21Replace IndexedResult with plain ResultAlexander Batischev1-11/+8
2021-07-21Replace IndexResult with plain ResultAlexander Batischev1-19/+16
2021-07-21Replace LocalGenerationResult with plain ResultAlexander Batischev1-24/+32
I do not plan to simplify the `T` in the return type of `get_file_and_fileno` because that function is only ever called from inside the module; it doesn't seem worthwhile to introduce a new type there.
2021-07-21Replace NascentResult with plain ResultAlexander Batischev1-5/+3
2021-07-21Replace FsIterResult with plain ResultAlexander Batischev2-8/+6