How to create a custom scheduled task

How to create a custom scheduled task such as daily maintenance or how to modify it, to define a verification task, for example the last login, this for when a person or user on a specific custom target system is more than XY days without signing in, Identity Manager can disable it.

Any help would be appreciated-