PATH = /home/raj/apps/HILIS4/script:/usr/local/bin:/usr/bin:/bin

HOURLY=/home/raj/apps/HILIS4/script/crons/hourly
DAILY=/home/raj/apps/HILIS4/script/crons/daily
WEEKLY=/home/raj/apps/HILIS4/script/crons/weekly
MONTHLY=/home/raj/apps/HILIS4/script/crons/monthly
QUARTERLY=/home/raj/apps/HILIS4/script/crons/quarterly
YEARLY=/home/raj/apps/HILIS4/script/crons/yearly
MULTI=/home/raj/apps/HILIS4/script/crons/multi
TEST=/home/raj/apps/HILIS4/script/crons/test_scripts
CRON_LOG=/home/raj/crons/cron.log

# @hourly $HOURLY/sysmex.sh 2>&1   #Lantronix socket monitor
# @hourly HOST=hmds-lth /home/raj/www/cgi-bin/env.pl >> $CRON_LOG 2>&1

@daily $DAILY/log_rotate.pl >> $CRON_LOG 2>&1
@daily $DAILY/expire_sessions.pl 'leeds' 'uclh' 'genomics' 'bristol' >> $CRON_LOG 2>&1 #expires sessions on hilis4 sessions tables
@daily $DAILY/expire_user_accounts.pl 'leeds' 'uclh' 'genomics' 'bristol' >> $CRON_LOG 2>&1
# 15 0 * * * $DAILY/email_reports.pl >> $CRON_LOG 2>&1
@daily $DAILY/chest_clinic_diagnosis_status_alert.pl >> $CRON_LOG 2>&1
@daily $DAILY/dlbcl_or_burkitt_diagnosis_alert.pl >> $CRON_LOG 2>&1
@daily $DAILY/suspected_all.pl >> $CRON_LOG 2>&1
@daily $DAILY/incomplete_requests.pl >> $CRON_LOG 2>&1
@daily $DAILY/new_trial_cases.pl >> $CRON_LOG 2>&1
@daily $DAILY/juvenile_diagnosis_status_alert.pl >> $CRON_LOG 2>&1
@daily $DAILY/diagnosis_status_alerts.pl >> $CRON_LOG 2>&1
@daily $DAILY/ppm_and_results.pl >> $CRON_LOG 2>&1
@daily $DAILY/unauthorised.pl >> $CRON_LOG 2>&1
@daily $DAILY/histopathology_referrals.pl >> $CRON_LOG 2>&1
# @daily $DAILY/new_national_code.pl >> $CRON_LOG 2>&1 # discontinued 21/1/2019 - email no longer monitored
@daily $DAILY/unscreened.pl >> $CRON_LOG 2>&1
@daily $DAILY/new_pnh_alert.pl >> $CRON_LOG 2>&1
@daily $DAILY/syncona-14mg.pl >> /home/raj/apps/HILIS4/logs/syncona-14mg.log 2>&1
@daily $DAILY/nbt_ice.pl >> $CRON_LOG 2>&1

@weekly $WEEKLY/cases_registered.pl >> $CRON_LOG 2>&1
@weekly $WEEKLY/error_log.pl >> $CRON_LOG 2>&1
@weekly $WEEKLY/mds_diagnoses.pl >> $CRON_LOG 2>&1
@daily $DAILY/national_code_unknown.pl >> $CRON_LOG 2>&1
@weekly $WEEKLY/null_nhs_number.pl >> $CRON_LOG 2>&1
@weekly $WEEKLY/overdue_for_auth.pl >> $CRON_LOG 2>&1
@weekly $WEEKLY/requests_and_reports.pl >> $CRON_LOG 2>&1
@weekly $WEEKLY/pathlinks.pl >> $CRON_LOG 2>&1
@weekly $WEEKLY/unreported.pl >> $CRON_LOG 2>&1
@weekly $WEEKLY/outreach_clinic_return.pl >> $CRON_LOG 2>&1
@weekly $WEEKLY/awaiting_final_diagnosis.pl >> $CRON_LOG 2>&1
@weekly $WEEKLY/rfc369-dlbcl.pl >> $CRON_LOG 2>&1
@weekly $WEEKLY/rfc370-follicular.pl >> $CRON_LOG 2>&1
@weekly CENTRE=uclh $WEEKLY/incomplete_lab_tests.pl >> $CRON_LOG 2>&1
# @monthly $MONTHLY/myelomaX_data.pl >> $CRON_LOG 2>&1
@monthly $MONTHLY/outreach_patients.pl >> $CRON_LOG 2>&1
@monthly $MONTHLY/register_and_error_log.pl >> $CRON_LOG 2>&1
# @monthly $MULTI/national_code_unknown.pl >> $CRON_LOG 2>&1 ## replaced by daily/national_code_unknown.pl
# @monthly $MONTHLY/myeloid_diagnoses.pl >> $CRON_LOG 2>&1 ## discontinued 07/2019
@monthly $MONTHLY/gallium_pending.pl >> $CRON_LOG 2>&1
@monthly $MONTHLY/gallium_data.pl >> $CRON_LOG 2>&1
@monthly $MONTHLY/request_followup.pl >> $CRON_LOG 2>&1
@monthly $MONTHLY/ods_data_files.pl >> $CRON_LOG 2>&1

0 0 1 1,4,7,10 * $QUARTERLY/trial_cases.pl >> $CRON_LOG 2>&1
0 1 5 1,4,7,10 * CENTRE=bristol $QUARTERLY/nbt_activity.pl >> $CRON_LOG 2>&1

@yearly $YEARLY/register_and_error_log.pl >> $CRON_LOG 2>&1
0 6 * * * $DAILY/potential_trial_cases.pl >> $CRON_LOG 2>&1
0 8 * * * $DAILY/grep_cron_log.pl >> $CRON_LOG 2>&1
0 0 1 1,4,7,10 * $QUARTERLY/ncg_pnh.pl >> $CRON_LOG 2>&1
1 0 2 * * $MONTHLY/activity_data.pl >> $CRON_LOG 2>&1
0 0-1,6-23 * * * $MULTI/mysql_backup.sh incremental >> /home/raj/crons/mysql_backup.log 2>&1
0 3 * * * $MULTI/mysql_backup.sh full >> /home/raj/crons/mysql_backup.log 2>&1
0 0 28 * * $MONTHLY/nycris.pl >> $CRON_LOG 2>&1
0 0 28 * * $MONTHLY/ncras_molecular_data.pl >> $CRON_LOG 2>&1
0 1 28 * * CENTRE=leeds $MONTHLY/ncrs_cosd.pl >> $CRON_LOG 2>&1
0 1 28 * * CENTRE=uclh $MONTHLY/ncrs_cosd.pl >> $CRON_LOG 2>&1
0 1 28 * * CENTRE=bristol $MONTHLY/ncrs_cosd.pl >> $CRON_LOG 2>&1
0 0 * * 3 $WEEKLY/teaching_cases.pl >> $CRON_LOG 2>&1
0 1 * * 0-5 $DAILY/missing_request_forms.pl >> $CRON_LOG 2>&1
# 0 4 * * * perl /home/raj/awstats/wwwroot/cgi-bin/awstats.pl -config=hmds -update #AWStats update

0 */3 * * * $HOURLY/outreach_haematology_alert.pl >> $CRON_LOG 2>&1
0 5 * * * $DAILY/ecsg_mysql_archive.sh 2>&1
# @hourly CENTRE=uclh /home/raj/scripts/env.pl 'leeds' 2>&1
# @hourly /home/raj/scripts/env.pl 'leeds' 2>&1
0 0 * * 5 $WEEKLY/ngs_myeloid_screening.pl >> $CRON_LOG 2>&1
@daily $DAILY/b-lpd-non-gc.pl >> $CRON_LOG 2>&1
@daily /home/raj/apps/querylog_rotate.pl >> $CRON_LOG 2>&1
# @weekly $WEEKLY/arctic_admire.pl >> $CRON_LOG 2>&1 # discontinued Oct/2018
@weekly $WEEKLY/notifications.pl >> $CRON_LOG 2>&1
0,15,30,45 * * * * $MULTI/genomics_xml.pl -s 900 >> /home/raj/crons/cron.log 2>&1
# 0 4 * * 1-5 $DAILY/print_run.pl >> $CRON_LOG 2>&1
@monthly $MONTHLY/cml_rq_pcr_monitoring.pl >> $CRON_LOG 2>&1
@daily CENTRE=uclh $DAILY/diagnosis_status_alerts.pl >> $CRON_LOG 2>&1
30 0 * * * CENTRE=uclh $DAILY/email_reports.pl >> $CRON_LOG 2>&1
@daily CENTRE=uclh $DAILY/status_complete.pl >> $CRON_LOG 2>&1
@monthly CENTRE=uclh $MONTHLY/lab_test_audit.pl >> $CRON_LOG 2>&1
0,30 * * * * CENTRE=uclh $HOURLY/report_available_notification.pl -t 1800 2>&1
30 0 * * * CENTRE=bristol $DAILY/email_reports.pl >> $CRON_LOG 2>&1

@hourly /usr/local/awstats/awstats.pl -config=hmds -update >/dev/null
@daily  /usr/local/awstats/awstats.pl -config=mail -update >/dev/null
@weekly mutt -s "New dictionary terms" ra.jones@hmds.org.uk < /home/raj/apps/HILIS4/static/speller/dicts/.aspell.leeds.temp
# 0 6 * * 1,4,6 $MULTI/uclh_outstanding_rfh.pl >> $CRON_LOG 2>&1 # disabled 14/11/16
@daily $DAILY/genomics_notifications.pl >> $CRON_LOG 2>&1
0,30 * * * * $HOURLY/report_available_notification.pl -t 1800 2>&1
# 30 1 * * * CENTRE=uclh $TEST/email_reports.pl 2>&1
# 0,30 * * * * $TEST/report_available_notification.pl -t 1800 2>&1
@weekly $WEEKLY/genomics_data.pl >> $CRON_LOG 2>&1
0 0 * * 4 $WEEKLY/genomics_data.pl >> $CRON_LOG 2>&1
5,20,35,50 * * * * $MULTI/genomics_xml_queue.pl >> /home/raj/crons/cron.log 2>&1
@monthly $MONTHLY/flair_trial_cases.pl >> $CRON_LOG 2>&1
15 0 * * * $DAILY/reports.pl >> $CRON_LOG 2>&1
@weekly $WEEKLY/cml_non_remission.pl >> $CRON_LOG 2>&1
# 30 5 * * 0 $WEEKLY/genomics_validation.pl -m >> $CRON_LOG 2>&1 # discontinued 4/3/19
# @monthly $MONTHLY/acute_non_myeloid.pl >> $CRON_LOG 2>&1 # discontinued 07/2019
#@daily $DAILY/genomics_haemonc.pl >> $CRON_LOG 2>&1 # discontinued Jan/2019
#@monthly $MONTHLY/genomics_dna_sample_saved.pl >> $CRON_LOG 2>&1 # discontinued Jan/2019
#@daily $DAILY/update_rfcs.sh >> $CRON_LOG 2>&1
@daily $DAILY/update_rfcs.sh >> /home/raj/apps/HILIS4/logs/rfc.log 2>&1
0 0 1 1,4,7,10 * $QUARTERLY/sectional_errors.pl >> $CRON_LOG 2>&1
0 0 1 1,4,7,10 * $QUARTERLY/rfc485-user_permissions.pl >> $CRON_LOG 2>&1

# 1st Friday of month:
0 6 1-7 * * [ "$(date '+\%a')" = "Fri" ] && $MONTHLY/geneq_data_extract.pl >> $CRON_LOG 2>&1
0 6 1-7 * * [ "$(date '+\%a')" = "Fri" ] && $MONTHLY/geneq_xna_extraction.pl >> $CRON_LOG 2>&1
# 3rd Friday of month:
0 6 15-21 * * [ "$(date '+\%a')" = "Fri" ] && $MONTHLY/geneq_data_extract.pl >> $CRON_LOG 2>&1
0 6 15-21 * * [ "$(date '+\%a')" = "Fri" ] && $MONTHLY/geneq_xna_extraction.pl >> $CRON_LOG 2>&1

# debugging...
#7 * * * * perl -le 'print for @INC' >> $CRON_LOG 2>&1
