File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree 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+ # crontab should be entered as follows
5+ # @reboot /root/remout_portal_source.sh > /dev/null 2>&1
6+ MOUNT_DIR=$( ls -l /dev/disk/by-id/google-* | grep google-singlecell-data-disk | awk -F ' /' ' { print $NF }' )
7+ if [[ -n " $MOUNT_DIR " ]]; then
8+ echo " $( date) : remounting google-singlecell-data-disk from /dev/$MOUNT_DIR " >> /home/jenkins/remount_log.txt
9+ mount -o discard,defaults /dev/$MOUNT_DIR /home/jenkins/deployments
10+ else
11+ echo -e " $( date) : cannot remount google-singlecell-data-disk, available disks:\n$( ls -l /dev/disk/by-id/google-* ) " >> /home/jenkins/remount_log.txt
12+ 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+ docker ps --filter " status=exited" | grep -e ' single_cell' | while read -r line ; do
7+ container_id=` echo $line | awk ' {print $1}' `
8+ container_name=` echo $line | awk ' {print $NF}' `
9+ echo " Restarting $container_name ($container_id ) on $( date) " >> /home/jenkins/deployments/single_cell_portal_core/log/cron_out.log
10+ docker restart $container_id
11+ done
You can’t perform that action at this time.
0 commit comments