diff --git a/jwrn3_test.sh b/jwrn3_test.sh deleted file mode 100644 index 877fe0a1767e86979365d798faa5ad9eb2fabe38..0000000000000000000000000000000000000000 --- a/jwrn3_test.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh - -# JWRN test script from within docker root -echo "jwrn3_test" > ./jwrn3_test_result \ No newline at end of file diff --git a/notes.txt b/notes.txt index ab61f42285384fd4a7e2f18db0062db749e8e1aa..2709d873a1d3518ca2628ff2618824bcab9770a9 100644 --- a/notes.txt +++ b/notes.txt @@ -2,16 +2,13 @@ Notes canto-space = /data/export/canto/canto - -OnCalendar=Mon 01:00:00 - +Systemd Copy files to /etc/systemd/system/ sudo systemctl start canto_weekly.timer -Working - -Is ssh passwordless set up for root? - No -Shuold weekly run as root or another user? +systemctl stop canto -Provide ssh ppublic key for fbadmin on deneb +Repository +https://gitlab.developers.cam.ac.uk/jwrn3/pdn-canto-config -https://gitlab.developers.cam.ac.uk/jwrn3/pdn-canto-config \ No newline at end of file +# Rsync from repo to canto-space +rsync -av /data/export/canto-space/pdn-canto-config/ /data/export/canto-space/ diff --git a/starting-pack.sh b/starting-pack.sh index 745308b8db05b5c95a2fc791df3f884d8169eef0..4d4bd291609112f7faec50f830756285a31ec39b 100644 --- a/starting-pack.sh +++ b/starting-pack.sh @@ -17,7 +17,7 @@ cp canto-docker-initd /sbin/ chmod a+x /sbin/canto-docker-initd cp canto-docker-initd ./canto/etc/ chmod a+x ./canto/etc/canto-docker-initd -rm canto-docker-initd +#rm canto-docker-initd ##create a 'canto' file @ /etc/init.d ##and make it executable @@ -45,6 +45,6 @@ done #run the weekly routine script which executes all configuration steps -sh weekly_routine.sh +# sh weekly_routine.sh diff --git a/test.sh b/test.sh deleted file mode 100755 index 63f87bff44b16ca6e69d41d203d149e488ef9ad6..0000000000000000000000000000000000000000 --- a/test.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/sh - -# Called if total failure happens -function fail { - # Echo output to stderr - echo "${1}" >&2 - - # Exit with non-zero code - exit 1 -} - -function retry { - # Define local vars - - # Starting number - local n=1 - - # Max number of attempts - local max=5 - - # Sleep period in seconds until retry - local delay=2 - - # Loop - while true; do - - # Run array of commands passed in and break loop if successful - "${@}" && break || { - - # Else loop while attempt no is less than max - if [[ "${n}" -lt "${max}" ]]; then - - # Increment attempt counter - ((n++)) - - # echo status - echo "Command failed. Attempt ${n}/${max}" - - # Sleep for period - sleep ${delay} - else - # Hit max attempts and still failed so giving up - fail "The command has failed after ${n} attempts." - fi - } - done -} - -# Grab file from Daneb -FILENAME="marker_file.txt" - -retry scp jwrn3@ent.csi.cam.ac.uk:"${FILENAME}" /tmp/ - -# Get DBNAME from downloaded file -if [[ -e "/tmp/${FILENAME}" ]]; then - DBNAME=$(cat "/tmp/${FILENAME}") -fi - -# Check DBNAME is not blank -if [[ -z ${BDNAME }]]; then - echo "${DBNAME} is blank, cannot continue" - exit 1 -fi - -# Transform $DBNAME -sed -E "s/(^[[:space:]]+\-[[:space:]]\"dbi\:Pg\:dbname=)[[:alpha:]]+(\;[[:space:]]host=deneb\.pdn\.cam\.ac\.uk\")/\1${DBNAME}\2/" canto_deployment.yaml \ No newline at end of file diff --git a/weekly_routine.sh b/weekly_routine.sh index bca794378a81194b030c06ebb2a8fef04fe1f0d1..8595187209bf7d16df08c30068407e87bd10c4af 100644 --- a/weekly_routine.sh +++ b/weekly_routine.sh @@ -144,7 +144,7 @@ if [[ -z ${BDNAME } ]]; then fi # Transform $DBNAME -CANTO_CONFIG="./canto_deploy.yaml" +CANTO_CONFIG=".canto/canto_deploy.yaml" if [[ -e "${CANTO_CONFIG}" ]]; then sed -i.bak -E "s/(^[[:space:]]+\-[[:space:]]\"dbi\:Pg\:dbname=)[[:alpha:]]+(\;[[:space:]]host=deneb\.pdn\.cam\.ac\.uk\")/\1${DBNAME}\2/" "${CANTO_CONFIG}"