export a csv file from the database with a cronjob

I'm using an event plugin, which doesn't have a user-friendly function for showing a list of bookings. That's why I wrote a php+js script myself to display that data in a nice way. But to use my own script I need the booking data from the wp database.

The MEC-plugin gives me an option to export this booking data in csv format from the admin dashboard. But I want to use this export as a cronjob, but have the hardest time to get this to work.

I tried to use this export link (/wp-admin/admin.php?page=MEC-ixtab=MEC-exportmec-ix-action=export-bookingsformat=csv) as an url in my cronjob php but I always get the login page as a return.

Is there a method to run this cronjob from within WP as admin so I don't have to login anymore? Or do I need to figure out how to login with cURL to WP to make this cronjob work?

Or are there even better/easier methodes to do something like this?

Any help would be welcome!

Topic curl wp-cron cron php Wordpress

Category Web

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.