File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
services/horizon/docker/verify-range Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 88CONTAINER_WORKING_DIR=" /data/job_${AWS_BATCH_JOB_ARRAY_INDEX:- 0} "
99echo " Job working directory path on data volume: $CONTAINER_WORKING_DIR "
1010
11+ cleanup () {
12+ # need to purge these files at end as the db and the downloaed datastore
13+ # files can be significatn GB's in size and in a cloud batch environment
14+ # we don't want to keep them around after the job is done, i.e. pay for that space still.
15+ sudo -u postgres --preserve-env=PGDATA /usr/lib/postgresql/14/bin/pg_ctl stop -D " $PGDATA "
16+ sudo chattr -R -i -a " $CONTAINER_WORKING_DIR "
17+ if [ -d " $CONTAINER_WORKING_DIR " ]; then
18+ sudo rm -rf " $CONTAINER_WORKING_DIR "
19+ echo " Purged working data files from $CONTAINER_WORKING_DIR "
20+ fi
21+ }
22+ trap cleanup EXIT
23+
1124# Ensure CONTAINER_WORKING_DIR exists and is empty
1225rm -rf " $CONTAINER_WORKING_DIR " /*
1326mkdir -p " $CONTAINER_WORKING_DIR "
You can’t perform that action at this time.
0 commit comments