# cronjobs run as maxx
# this file is organized by time of day
MAILTO=maxx@maxx.matrixgroup.net
RSYNC_RSH=ssh

# this section for freq of hour or less
53 * * * * /home/maxx/scripts/logReplicationProgress.sh

# make nea daily ownersplantscontractors.txt file for services reports
2 0 * * * /home/maxx/scripts/exportNeaAllNonOwnersPlantsContractors.py /home/matrix/current_nea/ /etc/httpd/conf/httpd-intranet.nea.conf -o /data/nea/protectedFiles/nonownersplantscontractors.txt
6 0 * * * /home/maxx/scripts/exportNeaAllOwnersPlantsContractors.py /home/matrix/current_nea/ /etc/httpd/conf/httpd-intranet.nea.conf -o /data/nea/protectedFiles/ownersplantscontractors.txt

# Nightly script to create Regular Members from Signatories
# BEFORE UNCOMMENTING SET DRYRUN TO 0 in the script!!!!!!!!!!! Done
3 1 * * * PYTHONPATH=/home/matrix/current_nea/libs /home/maxx/scripts/TAUC_sigToRegMem.py /home/matrix/current_nea/ /etc/httpd/conf/httpd-intranet.nea.conf 

# strip credit card numbers before the backup
5 1 * * * /home/maxx/scripts/stripCreditCard.py epsa
5 1 * * * /home/maxx/scripts/stripCreditCard.py eric
5 1 * * * /home/maxx/scripts/stripCreditCard.py aacrao
5 1 * * * /home/maxx/scripts/stripCreditCard.py naes
5 1 * * * /home/maxx/scripts/stripCreditCard.py nea

# scrape credit card batches from verisign for nea
#59 4 * * * cd /home/maxx/scripts/NewStyleScripts; ./CreateBatchForDay.py --save -u BatchScript nea yesterday

# scrape credit card batches from verisign for naes
45 6 * * * cd /home/maxx/scripts;/home/maxx/scripts/logonToVerisign.py /home/matrix/current_naes /etc/httpd/conf/httpd-intranet.naes.conf yesterday
53 6 * * * cd /home/maxx/scripts;/home/maxx/scripts/createBatchForDay.py /home/matrix/current_naes /etc/httpd/conf/httpd-intranet.naes.conf 0x6B100000001 naesbatch.txt

# build indecies for search engine
# removed indexpdfs mk2s 3/21/2007
#2 2 * * * /home/maxx/scripts/indexpdfs.py /home/matrix/current_epsa /etc/httpd/conf/httpd-www.epsa.conf /data/epsa/uploadFiles
2 2 * * * /home/maxx/scripts/indexDocuments.py /home/matrix/current_epsa /etc/httpd/conf/httpd-www.epsa.conf
#2 2 * * * /home/maxx/scripts/dailyReindexing.sh

# check permissions for aacrao
#10 2 * * * /home/maxx/scripts/findbadperms.sh
#10 2 * * * /home/maxx/scripts/findempty.sh

# trim the msgs database used for dupFilter
15 2 * * * /home/maxx/scripts/trimMsgs.sh

# regen mailing lists
20 2 * * * /home/maxx/scripts/saveMailingLists.py /home/matrix/current_epsa /etc/httpd/conf/httpd-intranet.epsa.conf
22 2 * * * /home/maxx/scripts/saveMailingLists.py /home/matrix/current_nea /etc/httpd/conf/httpd-intranet.nea.conf
30 2 * * * /home/maxx/scripts/saveMailingLists.py  /home/matrix/current_eric /etc/httpd/conf/httpd-intranet.eric.conf
25 2 * * * /home/maxx/scripts/saveMailingLists.py /home/matrix/current_naes /etc/httpd/conf/httpd-intranet.naes.conf

# cleare old sessions
3 3 * * * /home/maxx/scripts/deleteSessions.py

# dump dbs
5 3 * * * /home/maxx/scripts/dumpdbs.sh

# record stats of object counts daily
15 4 * * * /usr/local/bin/maxx-python /home/maxx/scripts/dbObjStats.py /home/matrix/current_aacrao /etc/httpd/conf/httpd-intranet.aacrao.conf record
15 4 * * * /usr/local/bin/maxx-python /home/maxx/scripts/dbObjStats.py /home/matrix/current_eric /etc/httpd/conf/httpd-intranet.eric.conf record
15 4 * * * /usr/local/bin/maxx-python /home/maxx/scripts/dbObjStats.py /home/matrix/current_epsa /etc/httpd/conf/httpd-intranet.epsa.conf record
15 4 * * * /usr/local/bin/maxx-python /home/maxx/scripts/dbObjStats.py /home/matrix/current_naes /etc/httpd/conf/httpd-intranet.naes.conf record

# mark indivs as former staff if company changes to non-active
10 5 * * * /home/maxx/scripts/markFormerStaff.py -p /home/matrix/current_naes -c /etc/httpd/conf/httpd-intranet.naes.conf -u 0xB4400000001
10 5 * * * /home/maxx/scripts/markFormerStaff.py -p /home/matrix/current_nea -c /etc/httpd/conf/httpd-intranet.nea.conf -u 0x8AE00000001

# dump database for clients 
43 5 * * * /usr/local/bin/maxx-python /home/maxx/scripts/dbDumpForClient.py /home/matrix/current_aacrao /etc/httpd/conf/httpd-www.aacrao.conf /data/aacrao/ryan/aacrao.sql.gz

# expire documents
45 5 * * * /usr/local/bin/maxx-python /home/maxx/scripts/expireDocuments.py /home/matrix/current_epsa /etc/httpd/conf/httpd-intranet.epsa.conf
45 5 * * * /usr/local/bin/maxx-python /home/maxx/scripts/expireDocuments.py /home/matrix/current_eric /etc/httpd/conf/httpd-intranet.eric.conf

# expire memberships for each client
0 6 * * * /usr/local/bin/maxx-python /home/maxx/scripts/expireMemberships.py /home/matrix/current_aacrao /etc/httpd/conf/httpd-www.aacrao.conf 275 expir_script
0 6 * * * /usr/local/bin/maxx-python /home/maxx/scripts/expireMemberships.py /home/matrix/current_epsa /etc/httpd/conf/httpd-www.epsa.conf 300 expir_script
0 6 * * * /usr/local/bin/maxx-python /home/maxx/scripts/expireMemberships.py /home/matrix/current_eric /etc/httpd/conf/httpd-www.eric.conf 300 expir_script
0 6 * * * /usr/local/bin/maxx-python /home/maxx/scripts/expireMemberships.py /home/matrix/current_nea /etc/httpd/conf/httpd-intranet.nea.conf 365 expir_script
# NAES overrides the grace period in their Membership.py classfile. So 365 should have no effect.
0 6 * * * /usr/local/bin/maxx-python /home/maxx/scripts/expireMemberships.py /home/matrix/current_naes /etc/httpd/conf/httpd-intranet.naes.conf 365 expir_script
# naes is intentionally not set -- WHY?? Turning this on per Tanya rharris 12/11/06

# copy pregenerated files
#00 6 * * * scp maxx2-x:/data/epsa/cachedFiles/*RegistrationReport_*.htm /data/epsa/cachedFiles/
#15 6 * * * scp maxx2-x:/data/eric/cachedFiles/*RegistrationReport_*.htm /data/eric/cachedFiles/
#30 6 * * * scp maxx2-x:/data/naes/cachedFiles/*RegistrationReport_*.htm /data/naes/cachedFiles/
#45 6 * * * scp maxx2-x:/data/nea/cachedFiles/*RegistrationReport_*.htm /data/nea/cachedFiles/
#15 7 * * * scp maxx2-x:/data/sqf/cachedFiles/*RegistrationReport_*.htm /data/sqf/cachedFiles/


# EPSA's cached report
16 6 * * * /home/maxx/scripts/createEPSAIndivReport.py /home/matrix/current_epsa/ /etc/httpd/conf/httpd-intranet.epsa.conf

# deactivate membership
25 6 * * * /usr/local/bin/maxx-python /home/maxx/scripts/deactivateMemberships.py /home/\matrix/current_epsa /etc/httpd/conf/httpd-intranet.epsa.conf
25 6 * * * /usr/local/bin/maxx-python /home/maxx/scripts/deactivateMemberships.py /home/\matrix/current_eric /etc/httpd/conf/httpd-intranet.eric.conf
25 6 * * * /usr/local/bin/maxx-python /home/maxx/scripts/deactivateMemberships.py /home/m\atrix/current_aacrao /etc/httpd/conf/httpd-intranet.aacrao.conf
25 6 * * * /usr/local/bin/maxx-python /home/maxx/scripts/deactivateMemberships.py /home/m\atrix/current_naes /etc/httpd/conf/httpd-intranet.naes.conf
25 6 * * * /usr/local/bin/maxx-python /home/maxx/scripts/deactivateMemberships.py /home/m\atrix/current_nea /etc/httpd/conf/httpd-intranet.nea.conf

# update committee pages
45 6 * * * /home/maxx/scripts/updateERICCommittees.sh /home/matrix/current_eric /etc/httpd/conf/httpd-intranet.eric.conf 8011
45 6 * * * /home/maxx/scripts/updateERICCommittees.sh /home/matrix/current_epsa /etc/httpd/conf/httpd-intranet.epsa.conf 8009

# Check/fix multiple active affiliations issue
#00 22 * * * /home/maxx/scripts/callPOMethod.py /home/matrix/current_aacrao /etc/httpd/conf/httpd-intranet.aacrao.conf Individual fixMultipleActiveAffiliationsCaseForAll printResult=1
#01 22 * * * /home/maxx/scripts/callPOMethod.py /home/matrix/current_epsa /etc/httpd/conf/httpd-intranet.epsa.conf Individual fixMultipleActiveAffiliationsCaseForAll printResult=1
#02 22 * * * /home/maxx/scripts/callPOMethod.py /home/matrix/current_eric /etc/httpd/conf/httpd-intranet.eric.conf Individual fixMultipleActiveAffiliationsCaseForAll printResult=1
#04 22 * * * /home/maxx/scripts/callPOMethod.py /home/matrix/current_naes /etc/httpd/conf/httpd-intranet.naes.conf Individual fixMultipleActiveAffiliationsCaseForAll printResult=1

# Check Individual.SACompanyName.  Should happen after the multiple active
# affiliations issue is run above.
#15 22 * * * /home/maxx/scripts/UpdateStoredAttributes.py -p /home/matrix/current_epsa -c /etc/httpd/conf/httpd-intranet.epsa.conf -n Individual -r SACompanyName
#16 22 * * * /home/maxx/scripts/UpdateStoredAttributes.py -p /home/matrix/current_eric -c /etc/httpd/conf/httpd-intranet.eric.conf -n Individual -r SACompanyName
#19 22 * * * /home/maxx/scripts/UpdateStoredAttributes.py -p /home/matrix/current_naes -c /etc/httpd/conf/httpd-intranet.naes.conf -n Individual -r SACompanyName
#19 22 * * * /home/maxx/scripts/UpdateStoredAttributes.py -p /home/matrix/current_nea -c /etc/httpd/conf/httpd-intranet.nea.conf -n Individual -r SACompanyName

# update nea sig apps to have late fees if appropriate
5 23 * * * /home/maxx/scripts/nea_UpdateLateFees.py -p /home/matrix/current_nea -c /etc/httpd/conf/httpd-intranet.nea.conf -u 0x2700000000 -s

# Remove old records from PageRequests table nightly for all dbs
15 6 * * * /home/maxx/scripts/deleteOldPageRequests.py localhost all

# once a month create new directories
59 6 1 * * python /home/maxx/scripts/createAacraoUsageDirectories.py | mail -s 'Output of createAacraoUsageDirectories.py on maxx6' maxx-operators@matrixgroup.net

# try to have everything done by 7am
9 7 * * * /home/maxx/scripts/doAACRAOExport.sh

# need this last line