Retrieving Files

Reading Files

When a file is written to an appliance filesystem, it is stored in the local disk cache, and you can read the file directly from the mounted directory. The file is asynchronously copied to the corresponding container or bucket in your account. To retrieve the data from the container or bucket in your account by using the appliance, read the required files from the mounted directory. The appliance will automatically place the files in the local cache, if space is available.

Note:

When a file is copied to an archive filesystem, it is stored in the local disk cache. After the file is asynchronously copied to the corresponding Archive container in Oracle Cloud Infrastructure Object Storage Classic, it is stored as an archived object. If the file is in the local disk cache, then you can retrieve the file immediately. However, if the file is not available in the local disk cache and stored in the Archive container, then you must first restore the archived object. For more information, see Restoring Files From Archive Filesystems.

If you try to download a file which does not exist in the local cache and is stored as an archived object, then an error message is displayed.

Reading the Checksum for a File

To read the checksum for a file in a filesystem, run the following command from the NFS client on which the filesystem is mounted:

cat /path/to/mountpoint/filename:::meta:csm

Restoring Files From Archive Filesystems

To download a file from an Archive filesystem, you must first restore the corresponding archived object in the container or bucket. The restored object is then downloaded and stored as a file in the appliance cache. Restoring archived files is an asynchronous operation.

To restore a file from an Archive filesystem, run the following command on the NFS client:

cat path_to_filename:::archive:restore

For example, a file myFirstFile is copied to a mounted directory myArchiveDir on the NFS client and is uploaded to an Archive filesystem myFirstArchiveFS. The file is asynchronously stored as an archived object in the myFirstArchiveFS-archive container or bucket in your account. To restore the archived object, enter the command:

cat /path_on_NFS_client/myArchiveDir/myFirstFile:::archive:restore

Sample Response:

For Oracle Cloud Infrastructure Object Storage accounts:

{"path":"/myFirstFile","restoreStatus":"inprogress","additionalInfo":""}

For Oracle Cloud Infrastructure Object Storage Classic accounts:

{"path":"/myFirstFile","restoreStatus":"inprogress","restoreObjectPercent":{"13456760 1079-11-v1":2},"additionalInfo":""}

Note:

You can restore an archived object in an archive container or bucket. If you try to restore an object in a standard container or bucket, then the following error message is displayed:

archive is not a valid command class

You can now track the restoration progress of the object in the myFirstArchiveFS-archive container or bucket. To track the object's restoration progress, see Tracking Restoration of a File in an Archive Filesystem.

You can now track the restoration progress of the object in the myFirstArchiveFS-archive container. To track the object's restoration progress, see Tracking Restoration of a File in an Archive Filesystem.

Note:

If the filesystem is deleted and if you restore an object in the Archive container or bucket at the same time, the object restoration is not affected.

Tracking Restoration of a File in an Archive Filesystem

To track the restoration progress of the file in the Archive filesystem, run the following command on the NFS client:

cat path_to_filename:::archive:restore-status

For example, a file myFirstFile is copied to a mounted directory myArchiveDir on the NFS client and is uploaded to myFirstArchiveFS. The file is asynchronously stored as an archived object in the myFirstArchiveFS-archive container or bucket in your account and you've run the command to restore the object. To track the restoration status, enter the command:

cat /path_on_NFS_client/myArchiveDir/myFirstFile:::archive:restore-status

Sample Response:

For Oracle Cloud Infrastructure Object Storage accounts:

{"path":"/myFirstFile","restoreStatus":"restored","additionalInfo":""}

For Oracle Cloud Infrastructure Object Storage Classic accounts:

{"path":"/myFirstFile","restoreStatus":"restored","restoreObjectPercent":{},"additionalInfo":""}

By default, a restored object will be downloaded and stored as a file in the Archive filesystem for one day. You can now read the file from the Archive filesystem before the restoration expires. For more information, see Reading Files.

Tracking Restoration of All Files in an Archive FileSystem

To track the restoration status of all the files in an Archive filesystem, run the following command:

cat /path_on_NFS_client_to_mounted_directory:::archive:jobs

The following is a sample response:

{"/myFirstFile":"restored","/mySecondFile":"inprogress", "/myThirdFile":"inprogress"}

Example:

The following is an example to show the restoration and tracking the restoration status of the files in an Archive filesystem myArchiveDir:

  1. Restoring the file myFirstFile:

    cat /mnt/dir1/myArchiveDir/myFirstFile:::archive:restore

    Output:

    For Oracle Cloud Infrastructure Object Storage accounts:

    {"path":"/myFirstFile","restoreStatus":"inprogress","additionalInfo":""}

    For Oracle Cloud Infrastructure Object Storage Classic accounts:

    {"path":"/myFirstFile","restoreStatus":"inprogress","restoreObjectPercent":{"1464707450825-13-v1":0},"additionalInfo":""}

  2. Restoring the file mySecondFile:

    cat /mnt/dir1/myArchiveDir/mySecondFile:::archive:restore

    Output:

    For Oracle Cloud Infrastructure Object Storage accounts:

    {"path":"/mySecondFile","restoreStatus":"inprogress","additionalInfo":""}

    For Oracle Cloud Infrastructure Object Storage Classic accounts:

    {"path":"/mySecondFile","restoreStatus":"inprogress","restoreObjectPercent":{"1353643456634-13-v1":0},"additionalInfo":""}

  3. Restoring the file myThirdFile:

    cat /mnt/dir1/myArchiveDir/myThirdFile:::archive:restore

    Output:

    For Oracle Cloud Infrastructure Object Storage accounts:

    {"path":"/myThirdFile","restoreStatus":"inprogress","additionalInfo":""}

    For Oracle Cloud Infrastructure Object Storage Classic accounts:

    {"path":"/myThirdFile","restoreStatus":"inprogress","restoreObjectPercent":{"1734537242537-13-v1":0},"additionalInfo":""}

  4. Tracking the restoration progress of all the files:

    cat /mnt/dir1/myArchiveDir/:::archive:jobs

    Output:

    {"/myFirstFile":"restored","/mySecondFile":"inprogress", "/myThirdFile":"inprogress”}