Batch create subscriptions

I want to run a task (maybe daily) that generates a new subscription for member whose one is going to expire in the next n days.

Another option that this task is executed manually by clicking on a button.

In each case, where is the best practice for placing for the file with the code. Should I create a new module for this?

Thanks a lot.

Best is to create module with 1 scheduled task.

Thanks eldy,

Just to be sure, what you propose is to use the standard module template, or create a new module with module builder, and then place a file in ¿class? folder, with a new class with a method that is called from scheduled task. Is that?

It is possible for a module to expand an existing class (in this case adherents) with a new method?

Thanks for your help.