Description Usage Arguments Details Note See Also Examples
mirror
copies files from from
to to
, deleting any files in to
that are not present in from
.
1 | mirror(from, to, exclude = "")
|
from |
path of source directory |
to |
path of destination directory |
exclude |
character vector of files or folders to exclude; paths are relative |
Uses rsync. Essentially creates a copy of from
at to
.
When syncing the contents of a directory, remember that it is important to include a forward slash (/
) at the end of both paths a
and b
; omitting in the second will create an extra copy in the first. If slash omitted from both, the top level name will exist 3 times and include two replicates. This is just basic rsync
syntax, but it is easy to forget.
See sync
for bidirectional copying w/o deletions (syncing). See rbLib-package
for package overview.
1 2 3 4 5 6 7 8 9 | ## Not run:
# I have a project in a folder called 'CyanoIso'
# I want two copies of this folder and its contents on my computer
from <- "Documents/School&Work/WiscResearch/CyanoIso/"
to <- "Dropbox/Cyanotopes/CyanoIso/" # omitting last slash creates extra copy
exclude <- c(".git", "Data")
(mirror(from, to, exclude))
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.