File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed
Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ # script to add to the root crontab to remount attached disk in correct location after scheduled instance restart,
4+ # which is used for staging and development VMs, but not production
5+
6+ # crontab should be entered as follows
7+ # @reboot /root/remout_portal_source.sh > /dev/null 2>&1
8+
9+ # More context: https://github.com/broadinstitute/single_cell_portal_core/pull/2216
10+ MOUNT_DIR=$( ls -l /dev/disk/by-id/google-* | grep google-singlecell-data-disk | awk -F ' /' ' { print $NF }' )
11+ if [[ -n " $MOUNT_DIR " ]]; then
12+ echo " $( date) : remounting google-singlecell-data-disk from /dev/$MOUNT_DIR " >> /home/jenkins/remount_log.txt
13+ mount -o discard,defaults /dev/$MOUNT_DIR /home/jenkins/deployments
14+ else
15+ echo -e " $( date) : cannot remount google-singlecell-data-disk, available disks:\n$( ls -l /dev/disk/by-id/google-* ) " >> /home/jenkins/remount_log.txt
16+ fi
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ # script to add to root crontab on a deployed host to check for crashed Docker containers and restart
4+ # crontab entry should be as follows:
5+ # */5 * * * * /root/restart_portal_container.sh > /dev/null 2>&1
6+
7+ # More context: https://github.com/broadinstitute/single_cell_portal_core/pull/2216
8+ docker ps --filter " status=exited" | grep -e ' single_cell' | while read -r line ; do
9+ container_id=` echo $line | awk ' {print $1}' `
10+ container_name=` echo $line | awk ' {print $NF}' `
11+ echo " Restarting $container_name ($container_id ) on $( date) " >> /home/jenkins/deployments/single_cell_portal_core/log/cron_out.log
12+ docker restart $container_id
13+ done
You can’t perform that action at this time.
0 commit comments