Browse Source

Add safety barrier to c_scan_N_fixed (to avoid accidental data loss)

master
Jean-Sébastien 2 years ago
parent
commit
0c3ad996b0
1 changed files with 11 additions and 0 deletions
  1. 11
    0
      scripts/catalogue/c_scan_N_fixed_data.sh

+ 11
- 0
scripts/catalogue/c_scan_N_fixed_data.sh View File

@@ -80,6 +80,17 @@ done
80 80
 
81 81
 basedir="$(pwd)"
82 82
 
83
+# Safety barrier:
84
+# if directory exists, don't do anything and request directory deletion before proceeding
85
+dircheck='Lieb-Liniger/'$correlator'/T_'$kBT'/c_scan_N_fixed/k_0_to_'${(l:2::0:)nkmax}'kFo4/sr_'$target_sumrule'/store/data/N_'$N
86
+echo $dircheck
87
+if [[ -d $dircheck ]]; then
88
+    echo 'A c scan with these parameters already exists. Aborting.'
89
+    echo 'If you really want to run this command, please first delete directory:\n'$dircheck
90
+    exit
91
+fi
92
+
93
+
83 94
 for c in $clist
84 95
 do
85 96
     echo '** Starting run for c =' $c', N = '$N | tee -a $logfile

Loading…
Cancel
Save