From 61dbe43a48cdc46b4b9a3f56b33e0000681b5e75 Mon Sep 17 00:00:00 2001 From: Ryan Polley Date: Fri, 22 Jan 2021 17:57:24 -0600 Subject: [PATCH 1/6] add examples --- docs/usage/create.rst | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/docs/usage/create.rst b/docs/usage/create.rst index 4b3966a474..0b5c72f63b 100644 --- a/docs/usage/create.rst +++ b/docs/usage/create.rst @@ -74,3 +74,14 @@ Examples $ cd /home/user/Documents # The root directory of the archive will be "projectA" $ borg create /path/to/repo::daily-projectA-{now:%Y-%m-%d} projectA + + # Use external command to determine files to archive + # Use --paths-from-stdin with find to only backup files less than 1MB in size + $ find ~ -size -1000k | borg create --paths-from-stdin /path/to/repo::small-files-only + # Use --paths-from-command with find to only backup files from a given user + $ borg create --paths-from-command -- /path/to/repo::joes-files find ~ -user joe + # Use --paths-from-stdin with --paths-separator to backup files listed in a csv file + $ echo files-to-backup.csv | borg create \ + --paths-from-stdin \ + --paths-separator "," \ + /path/to/repo::csv-specified-files From 8fe9ec9c52e2005ce33778d2d6f1db80aee3a77d Mon Sep 17 00:00:00 2001 From: Ryan Polley Date: Fri, 22 Jan 2021 22:56:02 -0600 Subject: [PATCH 2/6] fix csv example --- docs/usage/create.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/usage/create.rst b/docs/usage/create.rst index 0b5c72f63b..8f810b4c9e 100644 --- a/docs/usage/create.rst +++ b/docs/usage/create.rst @@ -80,8 +80,8 @@ Examples $ find ~ -size -1000k | borg create --paths-from-stdin /path/to/repo::small-files-only # Use --paths-from-command with find to only backup files from a given user $ borg create --paths-from-command -- /path/to/repo::joes-files find ~ -user joe - # Use --paths-from-stdin with --paths-separator to backup files listed in a csv file - $ echo files-to-backup.csv | borg create \ + # Use --paths-from-stdin with --paths-delimiter to backup files listed in a csv file + $ cat ~files-to-backup.csv | borg create \ --paths-from-stdin \ - --paths-separator "," \ + --paths-delimiter "," \ /path/to/repo::csv-specified-files From 5e338242557ebdc621ac93d6904577ec382c69e9 Mon Sep 17 00:00:00 2001 From: Ryan Polley Date: Sat, 23 Jan 2021 10:56:14 -0600 Subject: [PATCH 3/6] fix csv path --- docs/usage/create.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/create.rst b/docs/usage/create.rst index 8f810b4c9e..3c16413cfe 100644 --- a/docs/usage/create.rst +++ b/docs/usage/create.rst @@ -81,7 +81,7 @@ Examples # Use --paths-from-command with find to only backup files from a given user $ borg create --paths-from-command -- /path/to/repo::joes-files find ~ -user joe # Use --paths-from-stdin with --paths-delimiter to backup files listed in a csv file - $ cat ~files-to-backup.csv | borg create \ + $ cat ~/files-to-backup.csv | borg create \ --paths-from-stdin \ --paths-delimiter "," \ /path/to/repo::csv-specified-files From c888549d07aafa9a0f8d679a0ca25ddd815692d8 Mon Sep 17 00:00:00 2001 From: Ryan Polley Date: Sat, 23 Jan 2021 11:26:49 -0600 Subject: [PATCH 4/6] use find with print0 --- docs/usage/create.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/usage/create.rst b/docs/usage/create.rst index 3c16413cfe..13bedf1e61 100644 --- a/docs/usage/create.rst +++ b/docs/usage/create.rst @@ -80,8 +80,8 @@ Examples $ find ~ -size -1000k | borg create --paths-from-stdin /path/to/repo::small-files-only # Use --paths-from-command with find to only backup files from a given user $ borg create --paths-from-command -- /path/to/repo::joes-files find ~ -user joe - # Use --paths-from-stdin with --paths-delimiter to backup files listed in a csv file - $ cat ~/files-to-backup.csv | borg create \ + # Use --paths-from-stdin with --paths-delimiter (for example, for files with newlines in them) + $ find ~ -size -1000k -print0 | borg create \ --paths-from-stdin \ - --paths-delimiter "," \ - /path/to/repo::csv-specified-files + --paths-delimiter "\0" \ + /path/to/repo::smallfiles-handle-newline From 0881fc7fcad4cfa82af137f9a2bfbe58c42c8e17 Mon Sep 17 00:00:00 2001 From: Ryan Polley Date: Tue, 26 Jan 2021 12:06:52 -0600 Subject: [PATCH 5/6] revise paths-from-command example --- docs/usage/create.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/create.rst b/docs/usage/create.rst index 13bedf1e61..9392cbc6e3 100644 --- a/docs/usage/create.rst +++ b/docs/usage/create.rst @@ -79,7 +79,7 @@ Examples # Use --paths-from-stdin with find to only backup files less than 1MB in size $ find ~ -size -1000k | borg create --paths-from-stdin /path/to/repo::small-files-only # Use --paths-from-command with find to only backup files from a given user - $ borg create --paths-from-command -- /path/to/repo::joes-files find ~ -user joe + $ borg create --paths-from-command /path/to/repo::joes-files -- find /srv/samba/shared -user joe # Use --paths-from-stdin with --paths-delimiter (for example, for files with newlines in them) $ find ~ -size -1000k -print0 | borg create \ --paths-from-stdin \ From 2ab2dce47ea3a6d61842e7210a6aa914384028cd Mon Sep 17 00:00:00 2001 From: Ryan Polley Date: Tue, 26 Jan 2021 16:40:26 -0600 Subject: [PATCH 6/6] use wording "filenames with newlines in them" --- docs/usage/create.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/usage/create.rst b/docs/usage/create.rst index 9392cbc6e3..06d2748e17 100644 --- a/docs/usage/create.rst +++ b/docs/usage/create.rst @@ -80,7 +80,7 @@ Examples $ find ~ -size -1000k | borg create --paths-from-stdin /path/to/repo::small-files-only # Use --paths-from-command with find to only backup files from a given user $ borg create --paths-from-command /path/to/repo::joes-files -- find /srv/samba/shared -user joe - # Use --paths-from-stdin with --paths-delimiter (for example, for files with newlines in them) + # Use --paths-from-stdin with --paths-delimiter (for example, for filenames with newlines in them) $ find ~ -size -1000k -print0 | borg create \ --paths-from-stdin \ --paths-delimiter "\0" \