Files¶
Listing Files¶
ddev-live list
can list different types of objects including backups, databases, execs, files, restores, and sites.
The following command returns the file assets for the mysite
site. In this example, there is one file named foo.jpg in your files directory.
$ ddev-live list files mysite
FILE ASSETS
PATH
foo.jpg
File Backups¶
File backups are created on demand and are not run on a schedule. Once a backup has been generated it can be restored to a site.
ddev-live backup
initiates a job to create a backup of files. The output will contain a job name you can use to get more information.
$ ddev-live backup files mysite
Initiated files backup: ddev-demo/mysite-d6m5h
ddev-live describe
will give you the job's status.$ ddev-live describe backup file ddev-demo/mysite-d6m5h
Name: mysite-d6m5h
Org: ddev-demo
Created: 29s ago (2020-04-23 17:33:41 -0400 EDT)
FileStore: mysite
Type: export
Status: Completed
File Restores¶
ddev-live restore files
initiates a job to create a backup of files. The output will contain a job name you can use to get more information.
$ ddev-live restore files mysite
Initiated files restore ddev-demo/mysite-wtm5z
ddev-live describe
will give you the job's status.$ ddev-live describe restore files ddev-demo/mysite-wtm5z
Name: mysite-wtm5z
Org: ddev-demo
Created: 20s ago (2020-04-23 18:39:38 -0400 EDT)
FileStore: mysite
Type: import
Status: Completed
Pushing Files¶
ddev-live push
can move files and databases from your local environment to a site.
The following command pushes a file named foo.jpg from local to live.
$ ddev-live push files mysite foo.jpg
Uploaded: foo.jpg
To: backups/on-demand/foo.jpg
Pulling Files¶
ddev-live pull
can move files and databases from a site to your local environment.
The following command downloads a file named foo.jpg
from the mysite
site to the current local working directory.
$ ddev-live pull files mysite foo.jpg
Asset(s) downloaded.
The following command downloads all files from the
mysite
site to the local /home/ddev-demo/tmp
directory.
$ ddev-live pull files mysite --dest ~/tmp
trimmed: foo.jpg
localDestPath /home/ddev-demo/tmp/foo.jpg
Downloaded foo.jpg (1/2)
trimmed: bar.jpg
localDestPath /home/ddev-demo/tmp/bar.jpg
Downloaded bar.jpg (2/2)
Asset(s) downloaded.