Recently I have created a script to update records on my Wordpress database. I basically use wpdb to connect to another database, grap some records, and update the Wordpress database. Using only Wordpress, the initial solution that I found was put all the code on a custom template. So, when I visit a given URL, the update occurs.
This custom template do all the operations by itself, I don't even pass any argument to it. I only need to run/visit an URL.
The thing is that I don't want this script to be accessible to anyone, but at the same time, I need to run it on a scheduled cron job. So, what would be the better way to protect this script? Can anyone help me?