Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document --backup import behaviour #1788

Closed
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
8981b40
Document --backup import behaviour
charlesbaynham Sep 20, 2020
ded9bef
Restyled by prettier
restyled-commits Sep 20, 2020
e97d2da
Update content/docs/command-reference/import.md
jorgeorpinel Sep 20, 2020
5eb6ef7
Update content/docs/command-reference/import.md
jorgeorpinel Sep 20, 2020
f6ef819
Update content/docs/command-reference/import.md
jorgeorpinel Sep 20, 2020
a707366
Update content/docs/command-reference/import.md
jorgeorpinel Sep 20, 2020
a7aa282
Update content/docs/command-reference/import.md
jorgeorpinel Sep 20, 2020
15db349
Update content/docs/command-reference/import.md
jorgeorpinel Sep 20, 2020
476eb79
Apply suggestions from code review
charlesbaynham Sep 20, 2020
a7f4fd0
Move backup mode section and demote to h3
charlesbaynham Sep 20, 2020
6423f0f
Link back to backup mode section from dvc files page
charlesbaynham Sep 20, 2020
72e86bd
Links
charlesbaynham Sep 20, 2020
11e0286
Update content/docs/command-reference/import.md
jorgeorpinel Sep 21, 2020
880ef7a
Update content/docs/command-reference/import.md
jorgeorpinel Sep 21, 2020
a3c4201
Update content/docs/command-reference/import.md
jorgeorpinel Sep 21, 2020
d7549ef
Update content/docs/command-reference/import.md
jorgeorpinel Sep 21, 2020
dc7ea4b
Update content/docs/command-reference/import.md
jorgeorpinel Sep 21, 2020
ba32153
Update content/docs/command-reference/import.md
jorgeorpinel Sep 21, 2020
356f9dc
Update content/docs/command-reference/import.md
jorgeorpinel Sep 21, 2020
ab459bb
Update content/docs/command-reference/import.md
jorgeorpinel Sep 21, 2020
bd9fe56
Update content/docs/command-reference/import.md
jorgeorpinel Sep 21, 2020
60c69c5
Update import.md
charlesbaynham Sep 21, 2020
6ab19b0
Update content/docs/command-reference/import.md
jorgeorpinel Sep 21, 2020
1772f54
Update content/docs/command-reference/import.md
jorgeorpinel Sep 21, 2020
788b1c5
Update content/docs/command-reference/import.md
jorgeorpinel Sep 21, 2020
8b809c0
Update content/docs/command-reference/import.md
jorgeorpinel Sep 21, 2020
bec8136
Update content/docs/command-reference/import.md
jorgeorpinel Sep 21, 2020
b11a3ec
Update content/docs/user-guide/dvc-files-and-directories.md
jorgeorpinel Sep 21, 2020
732020a
Update content/docs/user-guide/dvc-files-and-directories.md
jorgeorpinel Sep 21, 2020
576e2bf
Update content/docs/command-reference/import.md
jorgeorpinel Sep 22, 2020
9e95f2c
Update content/docs/command-reference/import.md
jorgeorpinel Sep 22, 2020
df08768
Update content/docs/command-reference/import.md
jorgeorpinel Sep 22, 2020
747aee8
Update 'backup' to 'store' and add error link
charlesbaynham Oct 1, 2020
6da47c7
Allow merge with master
charlesbaynham Oct 1, 2020
1b52cdf
Update content/docs/command-reference/import.md
jorgeorpinel Oct 1, 2020
3e257cb
Update content/docs/command-reference/import.md
jorgeorpinel Oct 1, 2020
e8c036a
Update content/docs/command-reference/import.md
jorgeorpinel Oct 1, 2020
a6b9810
Update content/docs/user-guide/dvc-files-and-directories.md
jorgeorpinel Oct 1, 2020
7607697
Update content/docs/user-guide/troubleshooting.md
jorgeorpinel Oct 1, 2020
744db79
Update content/docs/command-reference/import.md
jorgeorpinel Oct 1, 2020
a02c827
Update content/docs/command-reference/import.md
jorgeorpinel Oct 1, 2020
73dd979
Update content/docs/command-reference/import.md
jorgeorpinel Oct 1, 2020
e98f488
Update content/docs/command-reference/import.md
jorgeorpinel Oct 1, 2020
4bef59b
Update content/docs/command-reference/import.md
jorgeorpinel Oct 1, 2020
c8d447c
Update content/docs/user-guide/dvc-files-and-directories.md
jorgeorpinel Oct 2, 2020
322ffa0
Update content/docs/user-guide/troubleshooting.md
jorgeorpinel Oct 2, 2020
4b48347
Update content/docs/user-guide/troubleshooting.md
jorgeorpinel Oct 2, 2020
1d29252
Update content/docs/user-guide/troubleshooting.md
jorgeorpinel Oct 2, 2020
1a39418
Update content/docs/user-guide/troubleshooting.md
jorgeorpinel Oct 26, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion content/docs/command-reference/import.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ the import.
## Synopsis

```usage
usage: dvc import [-h] [-q | -v] [-o <path>] [--rev <commit>] url path
usage: dvc import [-h] [-q | -v] [-o <path>] [--rev <commit>] [--backup] url path

positional arguments:
url Location of DVC or Git repository to download from
Expand Down Expand Up @@ -91,13 +91,32 @@ from the source repo.
> [Importing and updating fixed revisions](#example-importing-and-updating-fixed-revisions)
> example below).

- `-b`, `--backup` - imports files in "backup mode": see Backup Mode section for
details.
jorgeorpinel marked this conversation as resolved.
Show resolved Hide resolved

- `-h`, `--help` - prints the usage/help message, and exit.

- `-q`, `--quiet` - do not write anything to standard output. Exit with 0 if no
problems arise, otherwise 1.

- `-v`, `--verbose` - displays detailed tracing information.

## Backup Mode
jorgeorpinel marked this conversation as resolved.
Show resolved Hide resolved

To avoid duplicating large files, `dvc import` does not push imported files to
any configured remotes for your project by default. This means that when
jorgeorpinel marked this conversation as resolved.
Show resolved Hide resolved
`dvc pull/fetch` is run, DVC retrieves imports from their source instead of from
your remote. It also means that if the source of the import is deleted then the
jorgeorpinel marked this conversation as resolved.
Show resolved Hide resolved
files are not backed up in your remote, and data may be lost.

To prevent this, you can use the `--backup` option to request DVC to backup the
data imports to your project's remote. This also means that `dvc pull/fetch` no
jorgeorpinel marked this conversation as resolved.
Show resolved Hide resolved
longer needs to access import sources, so interacts only with the DVC remote,
and that backed-up imports can be restored just like files that were
`dvc add`ed.
jorgeorpinel marked this conversation as resolved.
Show resolved Hide resolved

To update backed-up imports, use `dvc update` like usual.
charlesbaynham marked this conversation as resolved.
Show resolved Hide resolved

## Examples

A simple case for this command is to import a dataset from an external <abbr>DVC
Expand Down
3 changes: 3 additions & 0 deletions content/docs/user-guide/dvc-files-and-directories.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ An _output entry_ (`outs`) consists of these fields:
_checksum_ for HDFS.
- `cache`: Whether or not this file or directory is <abbr>cached</abbr> (`true`
by default, if not present). See the `--no-commit` option of `dvc add`.
- `backup`: Whether or not this file or directory is backed-up to project
remotes. (`true` by default for all `outs` except imports, where it is `false`
by default).

A _dependency entry_ (`deps`) consists of these fields:

Expand Down