Skip to main content

Folder import

clouduler folder-import gets a file or folder that already exists on a node into a drive volume, then pushes it to every other node holding a copy right away. Use it to load an existing photo library, dataset or database dump into Clouduler without waiting for the next scheduled sync. It is a CLI command; the web UI has no equivalent.

How it works​

  1. The command runs on a node that implements the target drive. For a replicated drive that is any node holding it. For a served drive it is the active server or a node that mounts it. A standby candidate is refused, because the next sync from the real server would erase what you wrote.
  2. It places the source into <drive>/<volume> (or a sub-path inside it) as a copy, move or link.
  3. It records the volume in the cluster and marks this node as primary, then pushes the data to the peers immediately instead of waiting for the sync timer.

Import a folder​

Run it with enough privileges to write the drive folder (usually sudo). The CLI does not check for root and does not change ownership: copied and moved files keep your user's ownership, and that replicates to the other nodes.

# Copy (the default)
sudo clouduler folder-import ~/Downloads/dataset bulk/imports

# Move instead of copy (falls back to copy + delete across filesystems)
sudo clouduler folder-import -m /mnt/usb/photos bulk/photos

# Symlink instead of duplicating
sudo clouduler folder-import -l /mnt/usb/photos bulk/photos

# Put the source inside a sub-path of the volume
sudo clouduler folder-import ~/notes.txt bulk/docs/inbox

The target is <drive>/<volume>[/path inside volume]. Without -r, the source lands inside the volume (a folder keeps its name).

Replace a whole volume​

-r replaces the entire volume with the source. It takes no sub-path: the target must be exactly drive/volume.

sudo clouduler folder-import -r -f ./restored-db fast/postgres

Without -f, -r refuses to touch a volume that is in use. With -f, Clouduler stops the instances that mount the volume, clears it, imports, syncs, and starts them again.

Options​

Option
Type / default
Reload
Description
<source>required
pathno default
n/a
File or folder to import.
stringno default
n/a
Target inside the cluster.
flagdefault on
n/a
Copy the source in. The default.
Watch out: Mutually exclusive with -m and -l.
flagdefault off
n/a
Move the source in. Across filesystems it copies, then removes the source.
Watch out: Mutually exclusive with -c and -l.
flagdefault off
n/a
Replace the whole volume with the source.
Watch out: No sub-path allowed.
flagdefault off
n/a
With -r: stop instances mounting the volume first and start them after.
Watch out: Requires -r.
node namedefault hostname
n/a
Name of this node in the config. Also read from CLOUDULER_NODE.
node namedefault any manager
n/a
Node to submit the volume bookkeeping through.

Quirks and gotchas​