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
#!/usr/bin/env python | |
""" | |
Thin out old snapshots directories, so that after 6 months old, only one | |
per week is kept. | |
""" | |
import os | |
import re | |
import time |
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
#!/bin/sh | |
# | |
# create a copy of the ESGF mirror site, consisting of hard links | |
# | |
# make it in a temporary location, and if it succeeds, rename it | |
# to a dated directory under the webserver (outside of the main tree) | |
# | |
# otherwise, leaves it in tmp location to be cleaned up next time | |
# this cron job runs. |
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
#!/usr/bin/env python | |
""" | |
Generates an HTML file with a table listing the esg-node script versions | |
in each snapshot. | |
""" | |
import os | |
import glob | |
import re |
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
#!/usr/bin/env python | |
import os | |
import re | |
def read_properties(file="/esg/config/esgf.properties"): | |
"returns the esgf.properties as a dictionary" | |
d = {} | |
with open(file) as f: | |
for line in f.readlines(): |
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
#!/usr/bin/env python | |
import solr | |
import sys | |
""" | |
Identifies dataset in the Solr index for which the number_of_files in the | |
dataset record does not match the number of file records that reference | |
the dataset in the dataset_id of the file record. |
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
#!/usr/bin/env python | |
# Identifies the Solr file docs for which the timestamp has invalid format. | |
# before running this, ensure: | |
# | |
# - solrpy is available for import | |
# | |
# - solr has enough memory, e.g. in | |
# /usr/local/solr-home/master-8984/solr.in.sh |
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
import sys | |
import os | |
from cryptography import x509 | |
from cryptography.hazmat.backends import default_backend | |
import datetime | |
from myproxy.client import MyProxyClient as MPC | |
from OpenSSL.SSL import Error as SSLError | |
""" |
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
from cryptography import x509 | |
from cryptography.hazmat.backends import default_backend | |
import datetime | |
def cert_is_valid(cert_file, min_lifetime=0): | |
""" | |
Returns boolean - True if the certificate is in date. | |
Optional argument min_lifetime is the number of seconds |
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
""" | |
Gets a list of dataset IDs from the index node via the ESGF search. | |
""" | |
import requests | |
class GetSolrIDs(object): | |
def __init__(self, | |
url='https://c3s-models-index.ceda.ac.uk/esg-search/search/', |
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
""" | |
Gets a list of dataset IDs and projects from the index node via the ESGF search. | |
""" | |
import requests | |
class GetSolrIDs(object): | |
def __init__(self, | |
url='https://c3s-models-index.ceda.ac.uk/esg-search/search/', |
OlderNewer