Push tree to location. This function works out what packets are not known at the location and then what files are required to create them. It then pushes all the files required to build all packets and then pushes the missing metadata to the server. If the process is interrupted it is safe to resume and will only transfer files and packets that were missed on a previous call.
Arguments
- expr
An expression to search for. Often this will be a vector of ids, but you can use a query here.
- location
The name of a location to push to (see orderly_location_list for possible values).
- name
Optionally, the name of the packet to scope the query on. This will be intersected with
scope
arg and is a shorthand way of runningscope = list(name = "name")
- dry_run
Logical, indicating if we should print a summary but not make any changes.
- root
The path to the root directory, or
NULL
(the default) to search for one from the current working directory. This function does not require that the directory is configured for orderly, and can be anyoutpack
root (see orderly_init for details).
Value
Invisibly, details on the information that was actually moved (which might be more or less than what was requested, depending on the dependencies of packets and what was already known on the other location).
Examples
# Two roots, one local and one representing some remote orderly
# location. The remote location must use a file store at present.
local <- orderly_example()
#> ✔ Created orderly root at '/tmp/Rtmp3NBL3X/orderly2_ex_1cf177795a2e'
remote <- orderly_example(use_file_store = TRUE)
#> ✔ Created orderly root at '/tmp/Rtmp3NBL3X/orderly2_ex_1cf14b5b1d6c'
orderly_location_add_path("remote", remote, root = local)
#> ℹ Testing location
#> ✔ Location configured successfully
#> ✔ Added location 'remote' (path)
# We create a packet in the local root:
id <- orderly_run("data", root = local)
#> ℹ Starting packet 'data' `20250807-155618-d3a0b1ad` at 2025-08-07 15:56:18.831115
#> > orderly_description(
#> + display = "A demo data set")
#> > x <- jitter(1:30)
#> > y <- 0.4 * x + 5 + rnorm(length(x), sd = 2)
#> > d <- data.frame(x, y)
#> > orderly_artefact("data.rds", description = "A synthetic dataset")
#> > saveRDS(d, "data.rds")
#> ✔ Finished running data.R
#> ℹ Finished 20250807-155618-d3a0b1ad at 2025-08-07 15:56:18.856313 (0.02519774 secs)
# Push a packet into our remote version
orderly_location_push(id, location = "remote", root = local)
#> ℹ Pushing 2 files for 1 packet
#> ℹ Fetching metadata from 1 location: 'remote'
#> ✔ Found 1 packet at 'remote', of which 0 are new