Working...
Overview
As part of routine maintenance, Oracle Integration Cloud (OIC) embedded SFTP servers can accumulate a large number of archived files over time. These files consume storage and make file management difficult.
To address this, we developed a common utility integration that automatically removes archive files older than 30 days from the OIC Embedded SFTP server.
Business Requirement
Periodically clean up old archive files from the OIC Embedded SFTP server.
Retain only recent files for operational and audit purposes.
Automatically delete files older than 30 days.
Reduce manual maintenance effort.
Integration Flow
Scheduler Integration
The utility integration is triggered through an OIC Scheduler at a predefined interval (daily or weekly).
Scheduler
↓
Main Integration
↓
List Files from Embedded SFTP Root Directory
↓
Filter Files Older Than 30 Days
↓
For-Each File
↓
Delete File
↓
Log Processing Details
Implementation Details
Step 1: Scheduler Trigger
A scheduled integration initiates the cleanup process automatically based on the configured frequency.
Step 2: List Files
The integration connects to the OIC Embedded SFTP server and retrieves the list of files available under the root archive directory.
Step 3: Filter Files
For each file returned from the SFTP server:
Read the file's last modified date.
Compare it with the current date.
Calculate the age of the file.
Select files older than 30 days.
Step 4: Delete Files
A For-Each loop processes the filtered file list.
For every eligible file:
Verify the file exists.
Invoke the Delete File operation.
Record the deletion status for monitoring and auditing.
Step 5: Logging
The integration logs:
Total files scanned.
Total files identified for cleanup.
Successfully deleted files.
Failed deletion attempts, if any.
Benefits
Automated archive maintenance.
Reduced storage consumption.
Improved SFTP file management.
Eliminates manual cleanup activities.
Reusable utility service across multiple OIC projects.
Conclusion
This common utility service provides a simple and effective solution for maintaining the OIC Embedded SFTP server by automatically deleting archive files older than 30 days. By leveraging OIC Scheduler, SFTP Adapter, and For-Each processing, organizations can keep their integration environment clean, efficient, and easier to manage.
No comments:
Post a Comment