Enabling a policy for Cloud data sharing export service
This topic describes how to create a policy for export, a service provided by the IBM Storage Scale Cloud services, Cloud data sharing.
After you create a cloud storage account, you will want to create a policy for exporting data to
cloud storage. A sample policy is provided below. You can run this policy manually as needed or set
it up to run periodically – a cron job is frequently employed for this purpose. This policy is meant
to run weekly and exports files greater than one day old and less than eight days old.
Note: Do not
set this down to modified age of 0 if you want to run it in a cron job -- as it will only pick up a
partial list of files for day 0 and you may end up with get gaps or duplicates over your
week-to-week policy
runs.
define(
modified_age,
(DAYS(CURRENT_TIMESTAMP) - DAYS(MODIFICATION_TIME))
)
RULE EXTERNAL LIST 'export' EXEC '/opt/ibm/MCStore/bin/mcstore' OPTS '-e'
RULE 'files-to-export'
LIST 'export'
WHERE modified_age > 1 AND modified_age <= 8
How
this could be applied using a cron job:- Open a cron job editor by issuing this command:
crontab -e
- Add weekly export cron job by specifying this command:
@weekly mmapplypolicy {Device|Directory} -P PolicyFile
- Specify a command to export the journal to cloud storage here, if required.
- Specify the asynchronous notification of new files in the cloud here (pick your favorite notification tool).
- Save the file.