Review and Configure Retention Policies

File storage in the cloud might be constrained so it’s important to proactively manage limited file storage services by purging old instances and payloads.

In order to keep your database and storage resources from filling up, periodically purge artifacts from previous transfers. By default, Oracle Managed File Transfer Cloud Service checks daily at 8:00 AM for files that have been around longer than seven days and purges any that it finds. You can change these default values to suit your needs. How often you purge depends on your usage as does the length of time you retain the artifacts.

The tasks in the following topics describe how to change the retention value and the schedule.

Change the Purge Retention Policy

If you want to change the length of time you retain transfer artifacts such as old instances and payloads, edit the purgeInstanceData.py file located on each MFT managed server.

The following steps describe how to change the retention policy.
  1. ssh to the mft-purge directory located under the domain home directory on each managed server VM.
  2. On each MFT managed server, modify the retention days value by editing the following line in purgeInstanceData.py.
    retentionDays = 7  # Duration for which MFT Data has to be retained during purge operation

    For example:

    • retentionDays = 7 purges all data older than 1 week (default)

    • retentionDays = 14 purges all data older than 2 weeks

    • retentionDays = 1 purges all data older than 1 day

      This file can be edited at any time and the change takes effect for all future scheduled purges.

Change the Purge Schedule

By default, Oracle Managed File Transfer Cloud Service checks daily at 8:00 AM for files that have been around longer than the retention value and purges any that it finds. You can change the schedule to suit your needs. How often you purge depends on your usage.

Follow the instructions below if you use Oracle Managed File Transfer Cloud Service release 12.1.3 or 12.2.1. If you use release 12.2.1.2 or later, you can perform this task from the Administration page of the Oracle Managed File Transfer Console.
To change the purge schedule (for release 12.1.3 or 12.2.1):
  1. ssh to the mft-purge directory located under the domain home directory on each Managed Server VM.
  2. On each MFT Managed Server, modify the purge schedule by editing the values for frequency, interval, and begin_time in the following line in purge_schedule.py.
    manageSchedulerSchedule('CREATE', 'MFTCustomHostingApp',schName = scheduleName, frequency = 'DAY',interval = 1,begin_time = '08:00:00:01:01:2015')
    • frequency:  The frequency of recurrence. Valid values are: SECOND, MINUTE,HOUR,DAY, WEEK,MONTH, YEAR.

    • interval:  The integer value specifying the repeat interval for frequency. For example, an interval value of 2 combined with a frequency of WEEK, runs once every 2 weeks.

    • begin_time: The start time for the recurring schedule. The format is: HH:MM:SS:DD:MM:YYYY.

    Examples:

    • To run once per day at 8:00 AM:

      manageSchedulerSchedule('CREATE', 'MFTCustomHostingApp',schName = scheduleName, frequency = 'DAY',interval = 1, begin_time = '08:00:00:01:01:2016')
    • To run every two days at 8:00 AM:

      manageSchedulerSchedule('CREATE', 'MFTCustomHostingApp',schName = scheduleName, frequency = 'DAY',interval = 2, begin_time = '08:00:00:01:01:2016') 
    • To run once per week at midnight:

      manageSchedulerSchedule('CREATE', 'MFTCustomHostingApp',schName = scheduleName, frequency = 'WEEK',interval = 1, begin_time = '00:00:00:01:01:2016') 
  3. On any one of the running Managed Servers, follow these steps to cancel all existing jobs associated with the schedule:
    1. Log in to the Oracle Enterprise Manager (EM) console.
    2. Find Scheduling Services in the EM user interface.
    3. Click ESSAPP(mft_managed_server). For example, ESSAP(mft_server1).
    4. Click Show All Running Jobs.
    5. In the search menu that is displayed, find the name of the job you want to delete.
      See "Searching for Oracle Enterprise Scheduler Job Requests" in Administering Oracle Enterprise Scheduler ( 12.2.1.4 | 12.2.1.3 | 12.2.1.2 | 12.1.3).
    6. Click the job request that corresponds to the job you want to delete.
    7. Click Actions and then select Cancel to stop the job.
  4. Connect to WLST.
    1. ssh to any MFT managed server virtual machine and log in.
    2. cd to the bin directory under the MFT installation directory:

      cd mft_installation_directory/oracle_common/common/bin

    3. Run the ./wlst.sh command.
    4. Use the following command to connect to the server:

      connect(’username’,’password’,’t3://url_to_server:port_number’);

  5. Use the following commands to delete the schedule that you want to update:
    manageSchedulerSchedule('DELETE','MFTCustomHostingApp',schName='mft/purgeMFTInstances')
    manageSchedulerJobDefn('DELETE','MFTCustomHostingApp',jobName='mft/MFT_Purge')
  6. Use the following commands to verify that the schedule and job have been deleted from the hosting application.
    1. manageSchedulerJobDefn('SHOW','MFTCustomHostingApp')
      This command lists jobs running on the hosting application. Verify that the job definition you deleted is not listed.
    2. manageSchedulerSchedule('SHOW','MFTCustomHostingApp')
      This command lists schedules running on the hosting application. Verify that the schedule you deleted is not listed.
  7. On any one of the Oracle Managed File Transfer managed server nodes, run the startSchedulePurge.sh script located in the mft-purge directory located under the domain home directory on each managed server VM .

To read more about running Oracle Enterprise Scheduler WLST commands, see "Oracle Enterprise Scheduler Custom WLST Commands" in WLST Command Reference for SOA Suite (12.2.1.4 | 12.2.1.3 | Oracle 12.2.1.2 | Oracle 12.1.3).

To read more about using Oracle Enterprise Manager to monitor Oracle Enterprise Scheduler jobs, see "Managing Oracle Enterprise Scheduler Requests" in Administering Oracle Enterprise Scheduler. (12.2.1.4 | 12.2.1.3 | 12.2.1.2 | 12.1.3).