summaryrefslogtreecommitdiff
path: root/src/cmd
AgeCommit message (Collapse)AuthorFilesLines
2021-12-31docs: add documentation comments to crateLars Wirzenius13-4/+83
Also, make it an error for a public symbol to not be documented. Sponsored-by: author
2021-12-05chore: tidy up things found by newer Rust toolchainLars Wirzenius1-16/+0
Sponsored-by: author
2021-10-24feat! store schema version of generation database in the dbLars Wirzenius2-0/+37
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-08-16refactor: move file reading, etc, for backups to backup_runLars Wirzenius1-22/+4
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-09refactor: use async for "obnam backup"Lars Wirzenius1-11/+19
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-09Fix compilation on MacOSOssi Herrala1-1/+1
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-01refactor: use a struct for GenIdLars Wirzenius2-3/+3
This means a ChunkId can't be used instead. Sponsored-by: author
2021-08-01refactor: add a type alias for generation idsLars Wirzenius3-3/+3
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 Wirzenius2-0/+34
Sponsored-by: author
2021-07-30cleanup: fix things rustc/clipppy now complain aboutLars Wirzenius2-5/+5
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 Batischev1-2/+6
2021-07-28Store backup_roots() outcome in a structAlexander Batischev1-5/+10
2021-07-28After the backup, print out a list of new CACHEDIR.TAGsAlexander Batischev1-3/+11
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 Wirzenius1-4/+10
Sponsored-by: author
2021-07-23refactor: use async for "obnam list"Lars Wirzenius1-3/+9
Sponsored-by: author
2021-07-23refactor: use async for "obnam get-chunk"Lars Wirzenius1-4/+9
Sponsored-by: author
2021-07-21Replace RestoreResult with plain ResultAlexander Batischev1-11/+9
2021-07-18fix: use an explicit tokio runtimeLars Wirzenius1-2/+3
Create a tokio runtime so that the non-async function for chunkify can call an async function and have that create and run background tasks. Brown paper bag mistake: I did the development of this in a separate program with an async main function. When I integrated it into Obnam proper, which doesn't have an async main function (yet), I didn't actually test it works, only that it compiles. Stupid, stupid, stupid. I know better. Sponsored-by: author
2021-07-18feat: add "chunkify" subcommandLars Wirzenius2-0/+105
Sponsored-by: author
2021-07-05refactor: code to run backups to have less repetitionLars Wirzenius1-61/+21
This should make it easier to introduce async, later.
2021-06-19chore: bump dependency on indicatif to 0.16, and fix what's neededLars Wirzenius1-1/+1
Change calls to set_message to pass ownership of the message, rather than just letting it borrow the message. Sponsored-by: author
2021-06-13feat: restore symlink metadataAlexander Batischev1-7/+14
The weird thing about this commit is that all the tests for it already exist: the subplot compares manifests of "live" and restored data, and that includes the mtime. The subplot passes on CI, and it passed for me too — until today. Today, if I run `./check` on the main branch (which is currently at 481c5d8df21c72db3a3d76e851d25426f3e40647), subplot fails because the symlinks' mtime is wrong. Most often it's just the nsec part that's wrong: tests run fast enough that they finish within a second, and they rarely happen at the edge of the second. I don't understand why this didn't happen to me before, and why it doesn't happen to CI — and to Lars, for that matter. git-bisect points at 755c18a11f87040245964cf411ea8f518b61e0f5, which is a couple months old, so we should've spotted the breakage by now. Needless to say, I didn't do any major overhauls of my system lately, just your usual `apt upgrade` (Debian bullseye/testing amd64). Did some change in Subplot or Summain obfuscate this? It bothers me that I don't understand how we could miss this for so long.
2021-05-31feat: add subcommands for encrypting, decrypting individual chunksLars Wirzenius2-0/+65
2021-05-29refactor: only have client config without passwordsLars Wirzenius3-9/+3
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-29feat: improve error messagesLars Wirzenius1-15/+34
All unclear error messages should now be clearer. For example, all the ones related to a file mention the file name and the attempted operation that failed.
2021-04-26Port chunkids() to the iterator APIAlexander Batischev1-1/+2
2021-04-26Extend the iterator to users of LocalGeneration::files()Alexander Batischev3-5/+6
2021-04-26Expose fallibility of individual SQL resultsAlexander Batischev3-7/+13
`LocalGeneration::sql::files()` runs an SQL query, iterates over the results and collects the rows into a `Vec`. This can fail at any step: the query might fail to run, or one of the rows might fail to be fetched or processed. Right now, we lump all those failures into a `Result` that wraps the whole return value. This is only possible because we process each row before returning. Once `Vec` is replaced by an iterator, we won't have that luxury anymore, so we now wrap each individual element into its own `Result` (as well as wrapping the whole vector into a `Result` of its own).
2021-04-21feat: add support for CACHEDIR.TAGAlexander Batischev1-2/+2
Fixes #78.
2021-04-10refactor: have ClientConfigWithoutPasswords know its filenameLars Wirzenius1-7/+2
This allows Init::run to not need to be given it as an argument.
2021-04-10refactor: struct ShowConfig subcommandLars Wirzenius2-6/+10
2021-04-10refactor: struct GetChunk subcommandLars Wirzenius2-11/+18
2021-04-10refactor: struct Restore subcommandLars Wirzenius2-26/+42
2021-04-10refactor: struct ListFiles subcommandLars Wirzenius2-13/+20
2021-04-10refactor: struct ShowGeneration subcommandLars Wirzenius2-23/+30
2021-04-10refactor: struct List subcommandLars Wirzenius2-10/+14
2021-04-10refactor: struct Backup subcommandLars Wirzenius2-16/+20
2021-04-10refactor: struct Init subcommandLars Wirzenius2-19/+27
2021-04-10refactor: move ClientConfig into its own moduleLars Wirzenius8-8/+10
2021-04-09feat: add "obnam init" subcommandLars Wirzenius4-1/+34
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-04-06refactor: clean up initial and incremental backup code paths a bitLars Wirzenius1-14/+16
2021-04-06fix: finish off and clear the incremental backup progress barLars Wirzenius1-0/+1
2021-03-27refactor: return assigned value directlyLars Wirzenius1-2/+1
2021-03-12feat: show warnings for any problems backing up filesLars Wirzenius1-10/+30
Previously, we either ignored it or aborted the backup. Neither is good. Now we ignore the problem, except to show a warning at the end of the backup run.
2021-03-12fix: backup and restore of symlinkLars Wirzenius1-4/+2
2021-03-03fix: allow generation temporary files to be automatically deletedLars Wirzenius4-97/+53
By not calling NamedTempFile::persist, the files get deleted automatically when the file is closed or the struct is dropped. Previously we were deleting the temporary files manually, which meant that sometimes they weren't deleted if the program crashed at an unfortunate time.
2021-02-23feat: have separate progress bar for each backup phaseLars Wirzenius1-8/+8
2021-02-19feat: backup and restore named pipes (FIFOs)Lars Wirzenius2-1/+18