Drives
The zrok drives CLI tools allow for simple, ergonomic management and synchronization of local and remote files.
Sharing a Drive
Virtual drives are shared through the zrok
CLI using the --backend-mode drive
flag through the zrok share
command, using either the public
or private
sharing modes. We'll use the private
sharing mode for this example:
$ mkdir /tmp/junk
$ zrok share private --headless --backend-mode drive /tmp/junk
[ 0.124] INFO sdk-golang/ziti.(*listenerManager).createSessionWithBackoff: {session token=[cf640aac-2706-49ae-9cc9-9a497d67d9c5]} new service session
[ 0.145] INFO main.(*sharePrivateCommand).run: allow other to access your share with the following command:
zrok access private wkcfb58vj51l
The command shown above creates an ephemeral, private
drive share pointed at the local /tmp/junk
folder.
Notice that the share token allocated by zrok
is wkcfb58vj51l
. We'll use that share token to identify our virtual drive in the following operations.
Working with a Private Drive Share
First, let's copy a file into our virtual drive using the zrok copy
command:
$ zrok copy LICENSE zrok://wkcfb58vj51l
[ 0.119] INFO zrok/drives/sync.OneWay: => /LICENSE
copy complete!
We used the URL scheme zrok://<shareToken>
to refer to the private virtual drive we allocated above using the zrok share private
command. Use zrok://
URLs with the drives CLI tools to refer to contents of private virtual drives.
Next, let's get a directory listing of the virtual drive:
$ zrok ls zrok://wkcfb58vj51l
┌──────┬─────────┬─────────┬───────────────────────────────┐
│ TYPE │ NAME │ SIZE │ MODIFIED │