Deleting cloud objects

The standard way to delete cloud files is to set the --cloud-retention-period-days setting that sets a policy that indicates how long a file must be retained after it is deleted from the file system before it must be deleted from the cloud storage tier.

Periodically, the cloud directory is scanned for deleted files by a cloud destroy utility that runs in the background. That utility checks to see which files meet the criteria of being deleted and retained longer than the cloud retention period. Files that exceed the cloud retention period days are deleted automatically by that background utility.

You can delete files by using mmcloudgateway files delete command or by using external commands such as rm. With any of these commands, the files are only deleted from the local file system, but the corresponding cloud objects are marked for deletion. These marked objects are retained on the cloud for 30 days, by default. You can modify the retention time by running the following command:
mmcloudgateway config set

After the retention period expires, the marked files are permanently deleted from the cloud storage tier.

It is recommended that you apply the destroy policy that is described because of how file deletion works. For example, when you delete files by using external commands, the cloud objects are immediately marked for deletion only if you apply the destroy policy to the file system by using the mmchpolicy command. If the destroy policy is not applied, the cloud objects are marked for deletion only when you run the reconcile operation. The destroy policy is available here: /opt/ibm/MCStore/samples/cloudDestroy.policy.template. Additionally, you need to apply the destroy policy along with other policies such as transparent recall and migration.

If you want to permanently delete the marked files before the retention time expires, you can use the following command:
mmcloudgateway files destroy
Run the following command to set the retention period of the cloud objects to 60 days:
mmcloudgateway config set --cloud-retention-period-days 60
You can permanently delete the cloud objects that are marked for deletion from the cloud automatically by using the destroy policy or the reconcile command.
Note: You must delete the objects only after 60 days of marking.
Run the following command if you want to delete these objects earlier than 60 days (for example, 30 days):
mmcloudgateway files destroy --cloud-retention-period-days 30 --container-pair-set-name container-1
   --filesystem-path /gpfs/myfold 

Cloud objects that were marked for deletion 30 days or earlier (for files that are marked for deletion) are deleted. The cloud objects that were marked for deletion less than 30 days are retained.

For more information, see mmcloudgateway command.