export views data to text file in the background I am using views data export module to generate a text file and that works perfectly. but instead of asking me to save it to my local computer.

What I want to do is save it directly on the server, I would like to run this is the background if possible as large amounts of data take time to generate.
Ideally I would like to run this for each user in the background on cron run so I presume I will need to setup some batch job to run.
Well, I think you can set a cron job on server. You just need to add a drush command in crontab file. Drush command :

drush views-data-export [view-name] [display-id] [output-file]


Views data export provides this drush command.

Edit :


If you don't have drush installed on your server then you can take the idea from code of views_data_export.drush.inc.


Or :


In simple way you can run the code following in hook_cron : 

$output = views_embed_view('ViewName', 'views_data_export_1');
file_unmanaged_save_data($Output , 'private://output.xls', FILE_EXISTS_REPLACE);


As per https://www.drupal.org/node/1875456#comment-7524421.