It would be very awesome to be able to specify a sftp/ftps target with the cronjob runreport.pl job, to complement the ability currently available to email the report somewhere. Some kind of secure solve for "allowing the koha user to automatically accept the hostkey" on the first connection would also be nice, but not a requirement.
I like the idea, but maybe a workaround: would be using the 'access files' tools and a directory on the Koha server work? It would limit access to Koha staff users with the right permission set.
We do this in some places, but by and large our partners do not like this approach for a few reasons: They often have to send things other places without human intervention, on a schedule. The UX of the access_files is very poor (no directory structures allowed, cannot remove files themselves, among other things.) They have workflows that involve 3rd party vendors who require sftp/ftp deliveries of files. Right now, we generate the files and use other tools to deliver the files, which works but is very labor intensive when you have many of them to administer.
Thx for the reply, Liz, that makes sense.
Created attachment 189005 [details] [review] Bug 33308: Add S/FTP upload support to runreport.pl This patch adds S/FTP upload support to runreport.pl by adding additional command-line flags that will, when utilised, deposit a report onto the configured S/FTP Server. == TO TEST == a) Goto /cgi-bin/koha/admin/file_transports.pl?op=add_form b) Configure an S/FTP Server *) If one needs an S/FTP Server to utilise, contact me directly c) Configure an SQL report under Reports > Create from SQL *) If you're stuck, you can use `SELECT * FROM items` to select every item in k.t.d to report on == APPLY PATCH == d) Run `./misc/cronjobs/runreport.pl` without arguments *) Notice `--sftp-dest-id` and `--filename` *) `--sftp-dest-id` specifies the ID of the configured server to use, which can be garnered from the URL when editing the server (look for the file_transport_id parameter) *) `--filename` optionally specifies what the file should be called when uploaded, and can be customised with bash variables if necessary e) Run `./misc/cronjons/runreport.pl --sftp-dest-id 1 1` *) Notice the script outputs nothing, indicating success *) On your S/FTP server, notice a report now named report(id)-(date).csv *) Notice that the outputted file contains a CSV-formatted report f) Run `./misc/cronjobs/runreport.pl --format html --sftp-dest-id 1 1` *) Notice the script outputs nothing, indicating success *) On your S/FTP server, notice a report now named report(id)-(date).html *) Notice that the outputted file contains an HTML-formatted report g) Run `./misc/cronjons/runreport.pl --filename custom.csv --sftp-dest-id 1 1` *) Notice the script outputs nothing, indicating success *) On your S/FTP server, notice a report now named custom.csv *) Notice that the outputted file contains a CSV-formatted report h) Run `./misc/cronjons/runreport.pl --format html --filename custom.somehtml --sftp-dest-id 1 1` *) Notice the script outputs nothing, indicating success *) On your S/FTP server, notice a report now named custom.somehtml *) Notice that the outputted file contains an HTML-formatted report == SIGN OFF ==
Created attachment 189230 [details] [review] Bug 33308: Add S/FTP upload support to runreport.pl This patch adds S/FTP upload support to runreport.pl by adding additional command-line flags that will, when utilised, deposit a report onto the configured S/FTP Server. == TO TEST == a) Goto /cgi-bin/koha/admin/file_transports.pl?op=add_form b) Configure an S/FTP Server *) If one needs an S/FTP Server to utilise, contact me directly c) Configure an SQL report under Reports > Create from SQL *) If you're stuck, you can use `SELECT * FROM items` to select every item in k.t.d to report on == APPLY PATCH == d) Run `./misc/cronjobs/runreport.pl` without arguments *) Notice `--sftp-dest-id` and `--filename` *) `--sftp-dest-id` specifies the ID of the configured server to use, which can be garnered from the URL when editing the server (look for the file_transport_id parameter) *) `--filename` optionally specifies what the file should be called when uploaded, and can be customised with bash variables if necessary e) Run `./misc/cronjons/runreport.pl --sftp-dest-id 1 1` *) Notice the script outputs nothing, indicating success *) On your S/FTP server, notice a report now named report(id)-(date).csv *) Notice that the outputted file contains a CSV-formatted report f) Run `./misc/cronjobs/runreport.pl --format html --sftp-dest-id 1 1` *) Notice the script outputs nothing, indicating success *) On your S/FTP server, notice a report now named report(id)-(date).html *) Notice that the outputted file contains an HTML-formatted report g) Run `./misc/cronjons/runreport.pl --filename custom.csv --sftp-dest-id 1 1` *) Notice the script outputs nothing, indicating success *) On your S/FTP server, notice a report now named custom.csv *) Notice that the outputted file contains a CSV-formatted report h) Run `./misc/cronjons/runreport.pl --format html --filename custom.somehtml --sftp-dest-id 1 1` *) Notice the script outputs nothing, indicating success *) On your S/FTP server, notice a report now named custom.somehtml *) Notice that the outputted file contains an HTML-formatted report == SIGN OFF == Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com>