You can sync files between your computer and a service with persistent data volume attached.
Given the following deploy.yml
:
services:
chat:
volume_mount_path: /rails/storage
volume_size: 40
To sync the content of the mount path /rails/storage
into a directory on your computer:
# Create the directory to which we'll download the files
mkdir ~/tmp/chat-storage
# Download the contents of the whole persistent data volume
envirobly rsync chat: /tmp/chat-storage
# Download a specific file from some directory
envirobly rsync chat:some-directory/file.txt /tmp/chat-storage/
To upload files from your computer to the service data volume, simply reverse the first two arguments:
# Upload everything from /tmp/chat-storage to "chat" service data volume
envirobly rsync /tmp/chat-storage/ chat:
# Upload to a specific directory within the service data volume
envirobly rsync /tmp/chat-storage/ chat:some-directory/
Like with other commands, you can use arguments like --environ-name
,
to control what you’re targeting. See envirobly help rsync
for all the options you have.
For example:
# Download the contents of the data volume from service "chat"
# in the "production" environ
envirobly rsync chat: /tmp/chat-storage --environ-name production