This repository has been archived by the owner on Jun 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #70 from MITLibraries/retire-scripts
Disable Scheduled Jobs
- Loading branch information
Showing
8 changed files
with
133 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
# Cron jobs for credit card slips | ||
# | ||
# Daily at 0801 | ||
01 08 * * * gituser /home/gituser/alma-scripts/scripts/Credit-Card-Slips.sh | ||
# 01 08 * * * gituser /home/gituser/alma-scripts/scripts/Credit-Card-Slips.sh | ||
# | ||
#make sure to keep required newline at end of file - | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,6 @@ | ||
# Cron jobs for patron load | ||
# | ||
# Daily at 0301 | ||
01 03 * * * gituser /home/gituser/alma-scripts/scripts/Patron-load.sh | ||
# 01 03 * * * gituser /home/gituser/alma-scripts/scripts/Patron-load.sh | ||
# | ||
#make sure to keep required newline at end of file - | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
#!/bin/bash | ||
#source the environment variables here so that the script runs correctly for the cron user | ||
source /etc/profile | ||
# #!/bin/bash | ||
# #source the environment variables here so that the script runs correctly for the cron user | ||
# source /etc/profile | ||
|
||
#make the logs dir if it doesn't already exist | ||
mkdir /home/gituser/logs | ||
# #make the logs dir if it doesn't already exist | ||
# mkdir /home/gituser/logs | ||
|
||
#change to the alma-scripts directory | ||
cd /home/gituser/alma-scripts | ||
# #change to the alma-scripts directory | ||
# cd /home/gituser/alma-scripts | ||
|
||
#install the dependencies | ||
/usr/local/bin/pipenv install | ||
# #install the dependencies | ||
# /usr/local/bin/pipenv install | ||
|
||
#run the update, which automatically only uses the current days files | ||
# IF its the PROD instance, send it to the prod email address | ||
[[ $WORKSPACE == "prod" ]] && /usr/local/bin/pipenv run llama cc-slips --source_email noreply@libraries.mit.edu --recipient_email ils-lib@mit.edu --recipient_email monoacq@mit.edu > /home/gituser/logs/credit-card-slips.log 2>&1 || /usr/local/bin/pipenv run llama cc-slips --source_email noreply@libraries.mit.edu --recipient_email lib-alma-notifications@mit.edu > /home/gituser/logs/credit-card-slips.log 2>&1 | ||
# #run the update, which automatically only uses the current days files | ||
# # IF its the PROD instance, send it to the prod email address | ||
# [[ $WORKSPACE == "prod" ]] && /usr/local/bin/pipenv run llama cc-slips --source_email noreply@libraries.mit.edu --recipient_email ils-lib@mit.edu --recipient_email monoacq@mit.edu > /home/gituser/logs/credit-card-slips.log 2>&1 || /usr/local/bin/pipenv run llama cc-slips --source_email noreply@libraries.mit.edu --recipient_email lib-alma-notifications@mit.edu > /home/gituser/logs/credit-card-slips.log 2>&1 | ||
|
||
aws ses send-email --region us-east-1 --from noreply@libraries.mit.edu --to lib-alma-notifications@mit.edu --subject "Creditcardslips $WORKSPACE Job Completed" --text file:///home/gituser/logs/credit-card-slips.log | ||
# aws ses send-email --region us-east-1 --from noreply@libraries.mit.edu --to lib-alma-notifications@mit.edu --subject "Creditcardslips $WORKSPACE Job Completed" --text file:///home/gituser/logs/credit-card-slips.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
#!/bin/bash | ||
#source the environment variables here so that the script runs correctly for the cron user | ||
source /etc/profile | ||
# #!/bin/bash | ||
# #source the environment variables here so that the script runs correctly for the cron user | ||
# source /etc/profile | ||
|
||
#make the logs dir if it doesn't already exist | ||
mkdir /home/gituser/logs | ||
# #make the logs dir if it doesn't already exist | ||
# mkdir /home/gituser/logs | ||
|
||
#change to the alma-scripts directory | ||
cd /home/gituser/alma-scripts | ||
# #change to the alma-scripts directory | ||
# cd /home/gituser/alma-scripts | ||
|
||
#Get the current date, but dont use the day, we hard code that to use the 1st | ||
CURRENT_DATE="$(date +"%Y%m")01" | ||
# #Get the current date, but dont use the day, we hard code that to use the 1st | ||
# CURRENT_DATE="$(date +"%Y%m")01" | ||
|
||
#install the dependencies | ||
/usr/local/bin/pipenv install | ||
# #install the dependencies | ||
# /usr/local/bin/pipenv install | ||
|
||
#run the full update, this should only happen on the second of the month for files generated on the first. | ||
/usr/local/bin/pipenv run llama concat-timdex-export --export_type FULL --date "$CURRENT_DATE" > /home/gituser/logs/timdex-concat.log 2>&1 | ||
# #run the full update, this should only happen on the second of the month for files generated on the first. | ||
# /usr/local/bin/pipenv run llama concat-timdex-export --export_type FULL --date "$CURRENT_DATE" > /home/gituser/logs/timdex-concat.log 2>&1 | ||
|
||
# IF its the PROD instance, send it to the prod email address, otherwise, send to just our dev emails | ||
[[ $WORKSPACE == "prod" ]] && aws ses send-email --region us-east-1 --from noreply@libraries.mit.edu --to lib-alma-timdex-notifications@mit.edu --subject "PROD FULL Concat Job Completed" --text file:///home/gituser/logs/timdex-concat.log || aws ses send-email --region us-east-1 --from noreply@libraries.mit.edu --to lib-alma-notifications@mit.edu --subject "TESTING FULL Concat Job Completed" --text file:///home/gituser/logs/timdex-concat.log | ||
# # IF its the PROD instance, send it to the prod email address, otherwise, send to just our dev emails | ||
# [[ $WORKSPACE == "prod" ]] && aws ses send-email --region us-east-1 --from noreply@libraries.mit.edu --to lib-alma-timdex-notifications@mit.edu --subject "PROD FULL Concat Job Completed" --text file:///home/gituser/logs/timdex-concat.log || aws ses send-email --region us-east-1 --from noreply@libraries.mit.edu --to lib-alma-notifications@mit.edu --subject "TESTING FULL Concat Job Completed" --text file:///home/gituser/logs/timdex-concat.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,38 @@ | ||
#!/bin/bash | ||
#source the environment variables here so that the script runs correctly for the cron user | ||
source /etc/profile | ||
# #!/bin/bash | ||
# #source the environment variables here so that the script runs correctly for the cron user | ||
# source /etc/profile | ||
|
||
#make the logs dir if it doesn't already exist | ||
mkdir /home/gituser/logs | ||
# #make the logs dir if it doesn't already exist | ||
# mkdir /home/gituser/logs | ||
|
||
#change to the alma-scripts directory | ||
cd /home/gituser/alma-scripts/patronload | ||
# #change to the alma-scripts directory | ||
# cd /home/gituser/alma-scripts/patronload | ||
|
||
#install the dependencies | ||
/usr/local/bin/pipenv install | ||
# #install the dependencies | ||
# /usr/local/bin/pipenv install | ||
|
||
#Run the staff load | ||
/usr/local/bin/pipenv run python staff.py > /home/gituser/logs/patron-load.log 2>&1 | ||
# #Run the staff load | ||
# /usr/local/bin/pipenv run python staff.py > /home/gituser/logs/patron-load.log 2>&1 | ||
|
||
#Run the student load | ||
/usr/local/bin/pipenv run python student.py >> /home/gituser/logs/patron-load.log 2>&1 | ||
# #Run the student load | ||
# /usr/local/bin/pipenv run python student.py >> /home/gituser/logs/patron-load.log 2>&1 | ||
|
||
#make the folder if it doesn't already exist, this perl script errors out without the folder | ||
mkdir SEND | ||
# #make the folder if it doesn't already exist, this perl script errors out without the folder | ||
# mkdir SEND | ||
|
||
#Run the "zip function" that also does a diff and makes sure the staff files take precedence | ||
perl scripts/pack_all_records.pl >> /home/gituser/logs/patron-load.log 2>&1 | ||
# #Run the "zip function" that also does a diff and makes sure the staff files take precedence | ||
# perl scripts/pack_all_records.pl >> /home/gituser/logs/patron-load.log 2>&1 | ||
|
||
#Delete existing zips if they exist, we cant double up zip files if an alma run fails, files, once used, are renamed to .old | ||
aws s3 rm s3://$ALMA_BUCKET/exlibris/PatronLoad/ --exclude "*" --include "*.zip" >> /home/gituser/logs/patron-load.log 2>&1 | ||
# #Delete existing zips if they exist, we cant double up zip files if an alma run fails, files, once used, are renamed to .old | ||
# aws s3 rm s3://$ALMA_BUCKET/exlibris/PatronLoad/ --exclude "*" --include "*.zip" >> /home/gituser/logs/patron-load.log 2>&1 | ||
|
||
#Sync to the s3 bucket s3://alma-sftp-prod/exlibris/PatronLoad/ | ||
# MV also deletes the zip files if they are succesfully copied | ||
aws s3 mv SEND/ s3://$ALMA_BUCKET/exlibris/PatronLoad/ --exclude "*" --include "*.zip" --recursive >> /home/gituser/logs/patron-load.log 2>&1 | ||
# #Sync to the s3 bucket s3://alma-sftp-prod/exlibris/PatronLoad/ | ||
# # MV also deletes the zip files if they are succesfully copied | ||
# aws s3 mv SEND/ s3://$ALMA_BUCKET/exlibris/PatronLoad/ --exclude "*" --include "*.zip" --recursive >> /home/gituser/logs/patron-load.log 2>&1 | ||
|
||
#Send notify of job completion | ||
aws ses send-email --region us-east-1 --from noreply@libraries.mit.edu --to lib-alma-notifications@mit.edu --subject "Patronload $WORKSPACE Job Completed" --text file:///home/gituser/logs/patron-load.log | ||
# #Send notify of job completion | ||
# aws ses send-email --region us-east-1 --from noreply@libraries.mit.edu --to lib-alma-notifications@mit.edu --subject "Patronload $WORKSPACE Job Completed" --text file:///home/gituser/logs/patron-load.log | ||
|
||
# Remove the "rejects" files from the filesystem | ||
#rm rejects_students_script.txt | ||
#rm rejects_staff_script.txt | ||
# # Remove the "rejects" files from the filesystem | ||
# #rm rejects_students_script.txt | ||
# #rm rejects_staff_script.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
#!/bin/bash | ||
#source the environment variables here so that the script runs correctly for the cron user | ||
source /etc/profile | ||
# #!/bin/bash | ||
# #source the environment variables here so that the script runs correctly for the cron user | ||
# source /etc/profile | ||
|
||
#make the logs dir if it doesn't already exist | ||
mkdir /home/gituser/logs | ||
# #make the logs dir if it doesn't already exist | ||
# mkdir /home/gituser/logs | ||
|
||
#change to the alma-scripts directory | ||
cd /home/gituser/alma-scripts | ||
# #change to the alma-scripts directory | ||
# cd /home/gituser/alma-scripts | ||
|
||
#install the dependencies | ||
/usr/local/bin/pipenv install | ||
# #install the dependencies | ||
# /usr/local/bin/pipenv install | ||
|
||
#run the update, which automatically only uses the current days files | ||
/usr/local/bin/pipenv run llama concat-timdex-export --export_type UPDATE > /home/gituser/logs/timdex-concat.log 2>&1 | ||
# #run the update, which automatically only uses the current days files | ||
# /usr/local/bin/pipenv run llama concat-timdex-export --export_type UPDATE > /home/gituser/logs/timdex-concat.log 2>&1 | ||
|
||
# IF its the PROD instance, send it to the prod email address, otherwise, send to just our dev emails | ||
[[ $WORKSPACE == "prod" ]] && aws ses send-email --region us-east-1 --from noreply@libraries.mit.edu --to lib-alma-timdex-notifications@mit.edu --subject "PROD UPDATE Concat Job Completed" --text file:///home/gituser/logs/timdex-concat.log || aws ses send-email --region us-east-1 --from noreply@libraries.mit.edu --to lib-alma-notifications@mit.edu --subject "TESTING UPDATE Concat Job Completed" --text file:///home/gituser/logs/timdex-concat.log | ||
# # IF its the PROD instance, send it to the prod email address, otherwise, send to just our dev emails | ||
# [[ $WORKSPACE == "prod" ]] && aws ses send-email --region us-east-1 --from noreply@libraries.mit.edu --to lib-alma-timdex-notifications@mit.edu --subject "PROD UPDATE Concat Job Completed" --text file:///home/gituser/logs/timdex-concat.log || aws ses send-email --region us-east-1 --from noreply@libraries.mit.edu --to lib-alma-notifications@mit.edu --subject "TESTING UPDATE Concat Job Completed" --text file:///home/gituser/logs/timdex-concat.log |