Skip to content

Commit

Permalink
Merge pull request #119 from Mu2e/rrivera/addingListFeatureToSnapshots
Browse files Browse the repository at this point in the history
Added list feature to mu2e ots snapshots
  • Loading branch information
rrivera747 authored Oct 29, 2024
2 parents 727df4d + a333a75 commit 1f4e150
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion tools/get_mu2e_snapshot_data.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ ${cmd} 2> "$errlog"
if [[ -s "$errlog" ]]; then
error=`cat "$errlog"`
# File exists and has a size greater than zero
echo "THERE WAS AN SCP ERROR: You can use the following error to decide what to do"
echo -e `date +"%h%y %T"` "get_mu2e_snapshot_database.sh [${LINENO}] \t THERE WAS AN SCP ERROR: You can use the following error to decide what to do"
echo $error
rm $errlog
exit
Expand Down
2 changes: 1 addition & 1 deletion tools/get_mu2e_snapshot_database.sh
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ ${cmd} 2> "$errlog"
if [[ -s "$errlog" ]]; then
error=`cat "$errlog"`
# File exists and has a size greater than zero
echo "THERE WAS AN SCP ERROR: You can use the following error to decide what to do"
echo -e `date +"%h%y %T"` "get_mu2e_snapshot_database.sh [${LINENO}] \t THERE WAS AN SCP ERROR: You can use the following error to decide what to do"
echo $error
rm $errlog
exit
Expand Down
12 changes: 12 additions & 0 deletions tools/reset_mu2e_ots_snapshot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ echo -e `date +"%h%y %T"` "reset_mu2e_ots_snapshot.sh [${LINENO}] \t\t for exam
echo -e `date +"%h%y %T"` "reset_mu2e_ots_snapshot.sh [${LINENO}] \t\t\t reset_mu2e_ots_snapshot.sh --name a"
echo -e `date +"%h%y %T"` "reset_mu2e_ots_snapshot.sh [${LINENO}] \t"
echo -e `date +"%h%y %T"` "reset_mu2e_ots_snapshot.sh [${LINENO}] \t"
echo -e `date +"%h%y %T"` "reset_mu2e_ots_snapshot.sh [${LINENO}] \t\t or to see potential names..."
echo -e `date +"%h%y %T"` "reset_mu2e_ots_snapshot.sh [${LINENO}] \t\t\t reset_mu2e_ots_snapshot.sh --list"
echo -e `date +"%h%y %T"` "reset_mu2e_ots_snapshot.sh [${LINENO}] \t"

#return >/dev/null 2>&1 #return is used if script is sourced

Expand All @@ -39,6 +42,15 @@ echo
echo -e `date +"%h%y %T"` "reset_mu2e_ots_snapshot.sh [${LINENO}] \t Extracting parameters..."
echo

if [[ "$1" == "--list" ]]; then
echo -e `date +"%h%y %T"` "reset_mu2e_ots_snapshot.sh [${LINENO}] \t Listing existing snapshots (format = snapshot_<name>_Data/database.zip):"
ssh mu2eshift@mu2egateway01 "ls -lrta /mu2e/DataFiles/UserSnapshots/"
echo
echo -e `date +"%h%y %T"` "reset_mu2e_ots_snapshot.sh [${LINENO}] \t Existing snapshots above are in format = snapshot_<name>_Data/database.zip"
echo
return >/dev/null 2>&1 #return is used if script is sourced
exit #exit is used if script is run ./reset...
fi

if [[ "$1" == "--name" && "x$2" != "x" ]]; then
SNAPSHOT="$2"
Expand Down

0 comments on commit 1f4e150

Please sign in to comment.