#!/bin/bash

source ./munge/.env

read -p "DANGER! You are about to remove all images and videos. Are you sure? " -n 1 -r
echo    # (optional) move to a new line
if [[ $REPLY =~ ^[Yy]$ ]]
then
  cp /dev/null munge/munge.log
  cp /dev/null munge/ftp.log
  rm collection/{cams,log}.txt
  ARCHIVE=archive$(date +%Y%m%d%H%M)
  mkdir $ARCHIVE -p
  mv output/{write,images,videos} $ARCHIVE
  rm output/tmp/ -r
  rm output/count.json
  mkdir output/{images,videos}
  ssh ruth@gtp.ruthcatlow.net "mkdir ${GTP_BASE_DIR}archive/ -p; mv ${GTP_BASE_DIR}{images,videos} ${GTP_BASE_DIR}archive/; mv ${GTP_BASE_DIR}count.json ${GTP_BASE_DIR}archive/; mkdir ${GTP_BASE_DIR}{images,videos}"
fi

#!/bin/bash

source ./munge/.env

if [ "$USER" = "gareth" ]
then
  ROOT=/home/gareth/Projects/GEOLOGICALTIME/
else
  ROOT=/home/furtherfield/Desktop/GeologicalTime/
fi

cp /dev/null ${ROOT}munge/munge.log
cp /dev/null ${ROOT}munge/ftp.log
rm ${ROOT}collection/{cams,log}.txt
ARCHIVE=${ROOT}archive$(date +%Y%m%d%H%M)
mkdir $ARCHIVE -p
mv ${ROOT}output/{write,images,videos} $ARCHIVE
rm ${ROOT}output/tmp/ -r
rm ${ROOT}output/count.json
mkdir ${ROOT}output/{images,videos}
# ssh ruth@gtp.ruthcatlow.net "mkdir ${GTP_BASE_DIR}archive/ -p; mv ${GTP_BASE_DIR}{images,videos} ${GTP_BASE_DIR}archive/; mv ${GTP_BASE_DIR}count.json ${GTP_BASE_DIR}archive/; mkdir ${GTP_BASE_DIR}{images,videos}"

Clear can be run from cli
Clear can be run from cli
