# OS File System Cleanup Automation

Regular cleanup of operating system (OS) file systems ensures optimal system performance and helps maintain efficient storage utilization. Unused and obsolete files accumulate over time and can potentially impact system responsiveness. By regularly cleaning up OS file systems, organizations can improve overall system stability, enhance data accessibility, and reduce the risk of encountering storage-related issues such as file fragmentation and disk space shortages.

IT-Conductor offers seamless automation of OS file system cleanup on Unix/Linux, delivering enhanced performance management capabilities. It can be applied to one or more systems and can be run manually or on a schedule. This feature is highly adaptable to any customer environment and can become an essential component of IT maintenance operations.

### Prerequisites

* The system should be registered in IT-Conductor for monitoring.

<figure><img src="https://377464071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXhp08OmU8050PePmMgDt%2Fuploads%2FAiOJCVqwp7QIAOotJXbn%2FLinux%20Unix%20System%20in%20IT-Conductor%20Service%20Grid.png?alt=media&#x26;token=1d123713-c941-4731-b605-99113e0b14b5" alt=""><figcaption><p>Figure 1: Linux/Unix System in IT-Conductor Grid</p></figcaption></figure>

* A [Robot User](https://docs.itconductor.com/user-guide/account-administration/create-robot-users) should be created and associated with the application/DB/OS users with assigned roles/privileges to execute the local action on the system to be stopped/started.

<figure><img src="https://377464071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXhp08OmU8050PePmMgDt%2Fuploads%2FEmOPTpaMQJaZN1HUMytC%2Fimage.png?alt=media&#x26;token=c57683e2-c953-45d9-b13c-e8dda4df1d81" alt=""><figcaption><p>Figure 2: Start/Stop Process Definitions</p></figcaption></figure>

* The ownership of the process definition should be assigned to the [Robot User](https://docs.itconductor.com/user-guide/account-administration/create-robot-users).
* The [Robot User](https://docs.itconductor.com/user-guide/account-administration/create-robot-users) should be able to view the following recovery definitions when navigating to **Management > Automation > Recovery Definitions**.
  * Linux File System Cleanup

<figure><img src="https://377464071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXhp08OmU8050PePmMgDt%2Fuploads%2FH2E1atpHsQndHqzCSkbn%2FNavigating%20to%20Recovery%20Definitions.png?alt=media&#x26;token=ca49c572-1baa-458e-ad9a-74f870b5d316" alt=""><figcaption><p>Figure 3: Navigating to Recovery Definitions</p></figcaption></figure>

{% hint style="info" %}
**Note:** If the recovery definitions are not available for use, contact [IT-Conductor Support](https://docs.itconductor.com/reference/support).
{% endhint %}

### Automate OS File System Cleanup <a href="#how-to-automate-inbound-outbound-queue-restart" id="how-to-automate-inbound-outbound-queue-restart"></a>

1. Select the file system to implement the OS Filesystem Cleanup automation.

<figure><img src="https://377464071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXhp08OmU8050PePmMgDt%2Fuploads%2Fs9piqYbaxPuOXFsW8QeO%2FFile%20Systems%20in%20IT-Conductor%20Service%20Grid.png?alt=media&#x26;token=e802a92f-fc19-4fe1-999d-c88fb9e9b84c" alt=""><figcaption><p>Figure 4: Sybase File System in IT-Conductor Service Grid</p></figcaption></figure>

2. Click **Used %**.

<figure><img src="https://377464071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXhp08OmU8050PePmMgDt%2Fuploads%2F8gc03N6MGGEMgg19UG8m%2FSybase%20Filesystem%20Used%20Percentage.png?alt=media&#x26;token=cc69407a-3ac6-43b3-96d3-662bd80d848e" alt=""><figcaption><p>Figure 5: Sybase File System Used Percentage (%)</p></figcaption></figure>

3. Click the **Threshold Overrides** icon.

<figure><img src="https://377464071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXhp08OmU8050PePmMgDt%2Fuploads%2FERokHza4k8sZWHflDzAB%2FSybase%20Used%20Percentage%20Chart.png?alt=media&#x26;token=01c00457-77e8-4c59-b085-40002d8ae70c" alt=""><figcaption><p>Figure 6: Sybase File System Used Percentage Chart</p></figcaption></figure>

4. Select the targeted override.

<figure><img src="https://377464071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXhp08OmU8050PePmMgDt%2Fuploads%2FayNNpCaaH9VAHitdB6hf%2FSybase%20File%20System%20Used%20Percentage%20Overrides.png?alt=media&#x26;token=6e2c65f3-89a5-4948-85ea-360ad5ab943d" alt=""><figcaption><p>Figure 7: Sybase File System Used Percentage Overrides</p></figcaption></figure>

{% hint style="info" %}
**Note:** Select an override with the maintenance mode not enabled.
{% endhint %}

5. Configure the threshold and define the desired schedule for running the OS File System Cleanup automation.

<figure><img src="https://377464071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXhp08OmU8050PePmMgDt%2Fuploads%2FgZNTzI681a9nwd4IxxcE%2FLinux%20File%20System%20Used%20Space%20Configuration%20Settings.png?alt=media&#x26;token=facc0f8b-2cc6-4ceb-b989-83af4fa849e4" alt=""><figcaption><p>Figure 8: Linux File System Used Space Configuration Settings</p></figcaption></figure>

6. Select the desired recovery action in the **Recovery** dropdown menu.

<figure><img src="https://377464071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXhp08OmU8050PePmMgDt%2Fuploads%2Fnhg9WLlZvQIs5JaByr8X%2FSelecting%20Recovery%20Action%20Linux%20File%20System%20Cleanup.png?alt=media&#x26;token=bba68e2d-80f6-454f-b5b3-5034f8b18428" alt=""><figcaption><p>Figure 9: Selecting Linux File System Cleanup Recovery Action</p></figcaption></figure>

7. Select a process owner according to the concept of security and authority.

<figure><img src="https://377464071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXhp08OmU8050PePmMgDt%2Fuploads%2FwL0qf4CfTXUXAfKYp46o%2FSelecting%20File%20System%20Cleanup%20Process%20Owner.png?alt=media&#x26;token=521aefdb-39b0-42c7-a011-3b3e83402435" alt=""><figcaption><p>Figure 10: Selecting File System Cleanup Process Owner</p></figcaption></figure>

8. Configure to send a notification for this event. (Optional)

<figure><img src="https://377464071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXhp08OmU8050PePmMgDt%2Fuploads%2F0FCczP8mRgDOIbZvKl6I%2FConfiguring%20Recovery%20Notification%20for%20Sybase%20OS%20File%20System%20Cleanup%20Automation.png?alt=media&#x26;token=27be428c-e511-47f9-8b8f-4e2fadc13a7f" alt=""><figcaption><p>Figure 11: Configuring Recovery Notification for Sybase OS File System Cleanup Automation</p></figcaption></figure>

9. Click **Save** to complete the OS File System Cleanup automation.

<figure><img src="https://377464071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXhp08OmU8050PePmMgDt%2Fuploads%2FJ63Tty1CtYkSaKnszveP%2FSaving%20the%20Recovery%20Configurations%20for%20OS%20File%20System%20Cleanup%20Automation.png?alt=media&#x26;token=f5d46ce0-56c4-4508-ba9c-b93a8e0ad317" alt=""><figcaption><p>Figure 12: Saving the Recovery Configurations for OS File System Cleanup Automation</p></figcaption></figure>

### View Recovery Activities

1. Click the **Recovery Activities Launched** icon.

<figure><img src="https://377464071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXhp08OmU8050PePmMgDt%2Fuploads%2FGO3846zDJ82PWIS4Nktj%2FNavigating%20to%20Recovery%20Activities%20Launched_Linux%20Filesystem%20Cleanup.png?alt=media&#x26;token=7f1ae75b-b159-4228-8eb2-e97db3b2c2e6" alt=""><figcaption><p>Figure 13: Navigating to Recovery Activities Launched</p></figcaption></figure>

<figure><img src="https://377464071-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FXhp08OmU8050PePmMgDt%2Fuploads%2FVUOaMYtwTcOKkH34l5hW%2FRecovery%20Activities%20Launched_Linux%20Filesystem%20Cleanup.png?alt=media&#x26;token=8fa0fd1d-3825-4286-87c9-496d70f8a0f9" alt=""><figcaption><p>Figure 14: Recovery Activities Launched</p></figcaption></figure>
