How to use scheduler on server side script

Please check the example: Fetch late_entry field as count in employee doctype - #2 by NCP