I'm running Magento 1.7 and am looking to set up a Cronjob (Very little experience with this) to export my sales orders every 30min and place them in a folder on my desktop.
I only know how to manually export through Magento's Admin Panel.
It's not doable, or better shouldn't be done.
Your desktop PC would require a static IP address or a VPN connection with your Magento webserver in order to receive the files that were exported.
What can be done/should be done:
Create a module and add a cron task to the module's configuration:
<export_product_xml>
<name>Export orders every 30 minutes</name>
<short_description>Orders</short_description>
<description>Runs every 30 minutes to export orders</description>
<schedule>
<cron_expr>30 * * * *</cron_expr>
</schedule>
<run>
<model>namespace_module/observer::runOrdersExport</model>
</run>
</export_product_xml>
Define the model NameSpace_Module_Model_Observer
that will use predefined filtering (you can either export only new orders that were created in last 30 minutes, or all orders). Depending on the form of output you need you have to decide yourself it you'll create a separate file for each orders or add a row to an eg. CSV file.
class NameSpace_Module_Model_Observer {
public function runOrdersExport(Varien_Event_Observer $observer) {
//fetch and export the orders.
}
}
Now depending on the way you're gonna go, you can either:
a. Setup a scheduled task on your desktop Operating System (configuration depends on which one is it) that would download the order file(s) to your desktop from web server through FTP/SFTP.
b. Email yourself these files just after finishing the export.
c. If the desktop PC is in VPN connection/LAN connection with the webserver you can setup a cron task that would copy these files into your desktop PC network location.
d. (I strongly discourage this solution) Setup an FTP server on your PC and setup a cron task on webserver that would upload files there from webserver.