In version 0.5 we added the ability to download files and folders using jotta-cli.
jotta-cli download Archive/folder/subfolder ~/Downloads
Above is the syntax for starting a download. Archive/folder/subfolder
is the remote path
to the file or folder on jottacloud. ~/Downloads
is the download destination
where the files and folders will be downloaded to.
NB: If you are running jottad
and jotta-cli
on separate devices, you must specify a valid download destination
on the device where jottad
is running.
Command overview
jotta-cli download remote/path/to/file /local/download/destination
jotta-cli download --watch
jotta-cli download --abort=downloadid
jotta-cli list downloads
jotta-cli list downloadinformation --downloadid=downloadid [--json]
Starting a download
Understanding and finding the correct remote path
to download is perhaps the most confusing thing about downloading using jotta-cli
.
As on the website your files are grouped in "Sync", "Backup" and "Archive". See example below:
jotta-cli download Backup/MyImac/FolderWithStuff ~/Downloads
jotta-cli download Sync .
The correct remote-path
can be deduced from the file or folders location on the webpage but the intended method is to use bash-completion on MacOS and linux and jotta-cli ls
on windows. See Bash-completion below.
Once you have pressed return jotta-cli
waits while jottad
gathers the metadata necessary to perform the download. During this time you can abort the download using CTRL-C. Once the download starts jotta-cli prints some information about the download, including a downloadid
, and returns.
Cancelling a download
Once a download is started, you can cancel it by calling
jotta-cli download --abort=downloadid.
You can find the downloadid by calling jotta-cli list downloads
or jotta-cli download --watch
. When you cancel a download it leaves any files already succesfully downloaded on the filesystem. Any partially downloaded files are deleted.
Observing a download
You can watch the progress of a download using jotta-cli download --watch
.
Only one download will run at any time. If you have started multiple downloads the second will not start until the first has finished. Once a download completes it disappears from jotta-cli list downloads
except if one or more files failed to download.
Download errors
If a file could not be downloaded for any reason the download will complete, but it will not dissappear from jotta-cli list downloads
. To see detailed information about the download errors call jotta-cli list downloadinfo --downloadid=downloadid
. You can also add --json
to get error information in json format.
To clear a download from the list call jotta-cli download --abort=downloadid
.
Bash-completion
On MacOS and linux you can use bash completion to 'browse' the remote paths on jottacloud. Try the following:
jotta-cli download [TABTAB]
where [TABTAB] means you press TAB two times.
This should present an experience similar to browsing a local filesytem, though perhaps a bit slower depending on the latency to our servers. This works with jotta-cli ls [TABTAB]
as well, but not with a leading -l
as in jotta-cli ls -l [TABTAB]
.
More information: bash completion
If you encounter problems with paths not completing please open an issue on https://github.com/jotta/jotta-cli-issues or a send a support-ticket to support@jottacloud.com if you do not wish to disclose the filepaths in question publicly.