How to run a batch task

@Jasmine write a patch. Refrain from writing sql functions as it wont check for the validations etc
Check this post might help. How to apply a patch in custom app?