I'd like to add a line in my crontab to export the result of a view using this module but I'm experiencing some problems:
Here the line I'm using (in the shell):
drush -d -r /home/user1/public_html views-data-export numbers_report views_data_export_1 /home/user1/public_html/report.xls
This line end without creating the report.xls file and with a "The file could not be copied to the selected destination" error.
With the -d
(debug option) I isolated the line below:
Undefined variable: header views_data_export.theme.inc:300 [13.01 sec, 69.16 MB] [notice]
Undefined offset: 0 tablesort.inc:168 [13.01 sec, 69.16 MB] [notice]
Undefined offset: 0 tablesort.inc:173 [13.01 sec, 69.16 MB] [notice]
Undefined variable: output views_data_export.theme.inc:308 [13.01 sec, 69.16 MB] [notice]
The file could not be copied to the selected destination [13.01 sec, 69.16 MB] [error]
Command dispatch complete [13.01 sec, 69.16 MB] [notice]
Peak memory usage was 76.38 MB [13.01 sec, 69.16 MB] [memory]
Undefined offset: 0 tablesort.inc:168 [13.12 sec, 72.86 MB] [notice]
What's wrong in my line? Can anyone please help me? I see several people could export data via cron but couldn't find an example of the line in the cron.
(I also changed the permissions on that View, so that everybody can download the report)
Comments
Comment #1
Balbo CreditAttribution: Balbo commentedbump?
Comment #2
brephraim CreditAttribution: brephraim commentedSame problem here...
Comment #3
Steven Jones CreditAttribution: Steven Jones commentedIt would seem that Drush is having issues creating a file at the location you specified, does the user running Drush have permissions to write to that location?
You could try running:
With the same user and see if that call succeeds.
Comment #4
johnvI have a different, two-line approach, going to the desired location before starting drush:
Comment #5
Steven Jones CreditAttribution: Steven Jones commentedClosing after no response.
Comment #6
pnigro CreditAttribution: pnigro commentedHello,
I was experiencing the same problem. Below is the debug output by drush.
It looks like the export has to be saved in the drupal enviroment where "drush views-data-export" was executed in order for it to work. In my case the file would have to be saved in "/var/www/html/production/". Otherwise you end up with an invalid path "/var/www/html/production//var/www/html/production/feeds/feed.txt" which results in the error.
Therefore, the output file in "drush views-data-export [view-name] [display-id] [output-file]" cannot include an absolute path. For example:
I believe this is caused by:
in views_data_export.drush.inc.
I hope this helps others that have encountered this issue.
Thanks
Paul