Link Search Menu Expand Document

Backup and Restore Files and Directories

Table of Contents

There are two ways to backup files in the Elastio CLI:

  • elastio stream backup
  • elastio file backup

The difference between these two methods is that the Elastio stream backup is used to backup files or streams of data, while the Elastio file backup is used to backup files and directories (folders). Let’s look at how to back up files and directories here and then move on to back up and restore streams in the next section.

Elastio file backup

The elastio file backup command is used to backup single or multiple files and/or folders.

Use the following command to back up a single file and folder:

elastio file backup /path/foldername/filename1

or

elastio file backup /path/foldername1

Use the following command to back up several files and folders:

elastio file backup /path/filename1 /path/filename2 /path/folder1 /path/folder2 /path/folder3

Elastio file restore

The following commands can be used to restore files and folders from an Elastio backup or recovery point (RP).

Use the following command to restore all files and folders from the recovery point:

elastio file restore --rp <rp-id>

To restore a file from an RP with several files and folders and pipe it to .tar:

elastio file restore --rp <rp-id> <file-name> --target-file <file-name.tar>

Save all recovery point contents to a .tar archive:

elastio file restore --rp <rp-id> --target-file=<path/name>

By default, the CLI restores the contents into a folder where the CLI is being run, --target-dir allows to override this behaviour:

elastio file restore --rp <rp-id> --target-dir=<path/dir>

Restore only files that match the GLOB with the following command:

elastio file restore --rp <rp-id> --target-dir=<path/folder> --include "*mod*"

Restore only 1 file or folder from a recovery point with several items:

elastio file restore --rp <rp-id> --include "<file-name/folder-name>"

Restore only files that do not match the GLOB with the following command:

elastio file restore --rp <rp-id> --target-dir=<path/name> --exclude "*mod*"

Restore all files and folders from the recovery point except “file1”:

elastio file restore --rp <rp-id> --exclude "<path/file1>"