[Koha] How to receive reports to email
SATISH
lis4satish at gmail.com
Thu Mar 7 00:53:12 NZDT 2019
Thank you Paul, Barton, Alvaro
Still I am not able to run the said scripts. I am getting same permission
problem.
I tried to keep related files in /root directory and also in
/usr/share/koha/bin directory
same permission problem occurs. So, I did not understand it completely.
I need some more guidance to get desired results.
However, I also tried with other suggestions given in the mail,
since runreports.pl is already defined in koha,
I directly edited the file -- koha-common (etc/cron.d)
added following line,
45 17 * * * * root koha-foreach --enabled --email
/usr/share/koha/bin/cronjobs/runreport.pl report-id --format=html
--to=email id
I am successful.
But, for multiple reports, I am not successful.
45 17 * * * * root koha-foreach --enabled --email
/usr/share/koha/bin/cronjobs/runreport.pl report-id1 report-id2 report-id3
--format=html --to=email id
Checkout report - is taken from SQL library, developed by Sarah Cornel
List of items issued on a date with optional limit by due date
<https://wiki.koha-community.org/wiki/SQL_Reports_Library#List_of_items_issued_on_a_date_with_optional_limit_by_due_date>
with little modification in the last line, manual entry of 'issue date'
to 'current date' to chose date on which report is run.
SQL
------------------------------
SELECT
issuedate, date_due, items.barcode, items.itemcallnumber, biblio.title,
biblio.author, CONCAT(borrowers.firstname, ' ',borrowers.surname) AS
'patron',
borrowers.cardnumber, CONCAT(borrowers.borrowernumber) AS borrowernumber
FROM issues
LEFT JOIN items ON issues.itemnumber = items.itemnumber
LEFT JOIN biblio ON items.biblionumber = biblio.biblionumber
LEFT JOIN borrowers ON issues.borrowernumber = borrowers.borrowernumber
WHERE DATE(issuedate) = CURDATE()
-------------------------------
Since I missed to CC koha forum, I am copying imp mails from Paul received.
--
The twiddle character (~) in the koha-shell command is being interpreted
as root's home directory (/root), not as the regular user's home
directory (/home/helm-gechlibrary or whatever). The regular user can't
see inside /root, hence the permission error.
Try this:
# koha-shell gechlibrary -c '/home/helm-gechlibrary/bin/run-reports.pl
/home/helm-gechlibrary/reports/checkout-report.txt'
Or, equivalently:
# koha-shell gechlibrary -c '~helm-gechlibrary/bin/run-reports.pl
~helm-gechlibrary/reports/checkout-report.txt'
This should also work:
# koha-shell gechlibrary --login -c 'bin/run-reports.pl
reports/checkout-report.txt'
That's because the command -- i.e., the COMMAND in _koha-shell INSTANCE
--login -c COMMAND_ -- is executed by a process whose current working
directory is /home/helm-gechlibrary.
Good luck! Paul.
---
More information about the Koha
mailing list