Index: /branches/amp_3_7_2/amp.spec
===================================================================
--- /branches/amp_3_7_2/amp.spec	(revision 2851)
+++ /branches/amp_3_7_2/amp.spec	(working copy)
@@ -212,6 +212,7 @@
 install -Dm 0755 scripts/clean_oper_log.py %{buildroot}/ca/bin/clean_oper_log.py
 install -Dm 0755 scripts/export_es_snapshot.sh %{buildroot}/ca/bin/export_es_snapshot.sh
 install -Dm 0755 scripts/import_es_snapshot.sh %{buildroot}/ca/bin/import_es_snapshot.sh
+install -Dm 0755 scripts/amp-es-snapshot %{buildroot}/etc/logrotate.d/amp-es-snapshot
 cp conf/dashboard.ndjson %{buildroot}/ca/bin/
 cp scripts/import_kibana_dashboard.sh %{buildroot}/ca/bin/
 cp lib/composer/composer-2.5.0.2.tgz %{buildroot}/ca/etc/
@@ -293,6 +294,7 @@
 %attr (755,root,root)/ca/bin/import_kibana_dashboard.sh
 %attr (755,root,root)/ca/bin/export_es_snapshot.sh
 %attr (755,root,root)/ca/bin/import_es_snapshot.sh
+%attr (755,root,root)/etc/logrotate.d/amp-es-snapshot
 
 %define __debug_install_post   \
    %{_rpmconfigdir}/find-debuginfo.sh %{?_find_debuginfo_opts} "%{_builddir}/%{?buildsubdir}"\
Index: /branches/amp_3_7_2/scripts/amp-es-snapshot
===================================================================
--- /branches/amp_3_7_2/scripts/amp-es-snapshot	(nonexistent)
+++ /branches/amp_3_7_2/scripts/amp-es-snapshot	(working copy)
@@ -0,0 +1,12 @@
+/var/log/es_import.log
+/var/log/es_export.log
+{
+    daily
+    rotate 14
+    compress
+    delaycompress
+    missingok
+    notifempty
+    copytruncate
+    create 0640 root root
+}
\ No newline at end of file
Index: /branches/amp_3_7_2/scripts/export_es_snapshot.sh
===================================================================
--- /branches/amp_3_7_2/scripts/export_es_snapshot.sh	(revision 2880)
+++ /branches/amp_3_7_2/scripts/export_es_snapshot.sh	(working copy)
@@ -42,6 +42,28 @@
   exit 1
 }
 
+mkdir -p /var/run
+PID_FILE="/var/run/amp_export.pid"
+
+cleanup() {
+    rm -f "$PID_FILE"
+}
+
+if [[ -f "$PID_FILE" ]]; then
+    OLD_PID=$(cat "$PID_FILE")
+    if [[ -n "$OLD_PID" ]] && kill -0 "$OLD_PID" 2>/dev/null; then
+        log "ERROR: Export already running (PID $OLD_PID)"
+        exit 1
+    else
+        rm -f "$PID_FILE"  # stale PID
+    fi
+fi
+
+echo $$ > "$PID_FILE"
+log "Export PID: $$"
+
+trap cleanup EXIT INT TERM
+
 # ============================================================
 # ARGUMENT PARSER
 # ============================================================
\ No newline at end of file
@@ -181,34 +203,29 @@
 
     log "Transferring snapshot to ${REMOTE_USER}@${REMOTE_IP}:${REMOTE_PATH}"
 
-    RSYNC_OUTPUT=$(sshpass -p "$REMOTE_PASS" rsync -av \
+    sshpass -p "$REMOTE_PASS" rsync -avzh --progress \
         -e "ssh -o StrictHostKeyChecking=no -o ServerAliveInterval=60 -o ServerAliveCountMax=5" \
-        "$SNAPSHOT_DIR/" "$REMOTE_USER@$REMOTE_IP:${REMOTE_PATH}/" 2>&1)
-    
-    RSYNC_RET=$?
-    echo "$RSYNC_OUTPUT" >> "$EXPORT_LOG"
+        "$SNAPSHOT_DIR/" "$REMOTE_USER@$REMOTE_IP:${REMOTE_PATH}/" \
+        2>&1 | tee -a "$EXPORT_LOG"
 
-    if [ $RSYNC_RET -eq 0 ]; then
+    RSYNC_RET=${PIPESTATUS[0]}
+
+    if [[ $RSYNC_RET -eq 0 ]]; then
         log "Snapshot transferred to remote successfully (rsync)"
     else
         log "ERROR: rsync failed. Attempting fallback to SCP..."
-        echo "Rsync Output: $RSYNC_OUTPUT"
 
-        # FALLBACK TO SCP
-        # recursive copy of contents
-        SCP_OUTPUT=$(sshpass -p "$REMOTE_PASS" scp -r -o StrictHostKeyChecking=no \
-            "$SNAPSHOT_DIR"/* "$REMOTE_USER@$REMOTE_IP:${REMOTE_PATH}/" 2>&1)
-        
-        SCP_RET=$?
-        echo "$SCP_OUTPUT" >> "$EXPORT_LOG"
+        sshpass -p "$REMOTE_PASS" scp -rv \
+            -o StrictHostKeyChecking=no \
+            -o ServerAliveInterval=60 \
+            -o ServerAliveCountMax=5 \
+            "$SNAPSHOT_DIR"/. "$REMOTE_USER@$REMOTE_IP:${REMOTE_PATH}/" \
+            2>&1 | tee -a "$EXPORT_LOG"
 
-        if [ $SCP_RET -eq 0 ]; then
-             log "Snapshot transferred to remote successfully (scp)"
-        else
-             log "ERROR: SCP fallback failed"
-             echo "SCP Output: $SCP_OUTPUT"
-             fail "Remote transfer failed (rsync and scp)"
-        fi
+        SCP_RET=${PIPESTATUS[0]}
+
+        [[ $SCP_RET -eq 0 ]] || fail "Remote transfer failed (rsync and scp)"
+        log "Snapshot transferred to remote successfully (scp)"
     fi
 fi
 
\ No newline at end of file
Index: /branches/amp_3_7_2/scripts/import_es_snapshot.sh
===================================================================
--- /branches/amp_3_7_2/scripts/import_es_snapshot.sh	(revision 2880)
+++ /branches/amp_3_7_2/scripts/import_es_snapshot.sh	(working copy)
@@ -29,16 +29,39 @@
 REPO_NAME="amp_restore_repo_${TIMESTAMP}"
 
 SSH_OPTS="-o StrictHostKeyChecking=no"
-
 log() { echo "$(date '+%F %T') $1" | tee -a "$LOG_FILE"; }
 fail() { log "ERROR: $1"; exit 1; }
 
+mkdir -p /var/run
+PID_FILE="/var/run/amp_import.pid"
+
+cleanup() {
+    rm -f "$PID_FILE"
+}
+
+if [[ -f "$PID_FILE" ]]; then
+    OLD_PID=$(cat "$PID_FILE")
+    if [[ -n "$OLD_PID" ]] && kill -0 "$OLD_PID" 2>/dev/null; then
+        log "ERROR: Import already running (PID $OLD_PID)"
+        exit 1
+    else
+        rm -f "$PID_FILE"  # stale PID
+    fi
+fi
+
+echo $$ > "$PID_FILE"
+log "Import PID: $$"
+
+trap cleanup EXIT INT TERM
+
 # ============================================================
 # START LOG
 # ============================================================
 log "==============================================="
 log " STARTING ELASTICSEARCH SNAPSHOT IMPORT "
 
+echo $$ > "$PID_FILE"
+
 # -----------------------------------------------
 # Parse CLI arguments
 # -----------------------------------------------
\ No newline at end of file
@@ -104,29 +127,26 @@
 # ----------------------------------------------------------
 log "[3/9] Copying snapshot directory..."
 
-RSYNC_OUTPUT=$(sshpass -p "$AMP_PASS" rsync -avz \
+sshpass -p "$AMP_PASS" rsync -avzh --progress \
     -e "ssh $SSH_OPTS" \
-    "$AMP_USER@$AMP_IP:$DIR/" "$IMPORT_DIR/" 2>&1)
+    "$AMP_USER@$AMP_IP:$DIR/" "$IMPORT_DIR/" \
+    2>&1 | tee -a "$LOG_FILE"
 
-RSYNC_RET=$?
-echo "$RSYNC_OUTPUT" >> "$LOG_FILE"
+RSYNC_RET=${PIPESTATUS[0]}
 
-if [ $RSYNC_RET -eq 0 ]; then
+if [[ $RSYNC_RET -eq 0 ]]; then
     log "Snapshot directory copied successfully (rsync)"
 else
     log "ERROR: rsync failed. Attempting fallback to SCP..."
 
-    SCP_OUTPUT=$(sshpass -p "$AMP_PASS" scp -r $SSH_OPTS \
-        "$AMP_USER@$AMP_IP:$DIR/"* "$IMPORT_DIR/" 2>&1)
+    sshpass -p "$AMP_PASS" scp -rv $SSH_OPTS \
+        "$AMP_USER@$AMP_IP:$DIR"/. "$IMPORT_DIR/" \
+        2>&1 | tee -a "$LOG_FILE"
 
-    SCP_RET=$?
-    echo "$SCP_OUTPUT" >> "$LOG_FILE"
+    SCP_RET=${PIPESTATUS[0]}
+    [[ $SCP_RET -eq 0 ]] || fail "Remote copy failed (rsync and scp)"
 
-    if [ $SCP_RET -eq 0 ]; then
-        log "Snapshot directory copied successfully (scp)"
-    else
-        fail "Remote copy failed (rsync and scp)"
-    fi
+    log "Snapshot directory copied successfully (scp)"
 fi
 
 log "Fixing snapshot directory ownership..."
\ No newline at end of file
Index: /branches/amp_3_7_2/src/webui/webui/htdocs/new/src/hive/controller/snapshot_controller.py
===================================================================
--- /branches/amp_3_7_2/src/webui/webui/htdocs/new/src/hive/controller/snapshot_controller.py	(revision 2880)
+++ /branches/amp_3_7_2/src/webui/webui/htdocs/new/src/hive/controller/snapshot_controller.py	(working copy)
@@ -12,6 +12,8 @@
 
 LOG_FILE_IMPORT = "/var/log/es_import.log"
 LOG_FILE_EXPORT = "/var/log/es_export.log"
+PID_FILE_IMPORT = "/var/run/amp_import.pid"
+PID_FILE_EXPORT = "/var/run/amp_export.pid"
 
 
 def json_response(data, status=200):
@@ -172,6 +174,19 @@
         return json_response({"status": "Failed", "error": 500, "message": "Error Importing Snapshot:"}, 500)
 
 
+def is_job_really_running(pid_file):
+    if not os.path.exists(pid_file):
+        return False
+
+    try:
+        with open(pid_file) as f:
+            pid = int(f.read().strip())
+        os.kill(pid, 0)  # check only
+        return True
+    except Exception:
+        return False
+
+
 # ============================================================
 # STATUS HANDLERS
 # ============================================================
@@ -209,7 +224,7 @@
     # If no marker found, consider entire log
     relevant_lines = lines[start_idx:] if start_idx is not None else lines
     # Only inspect last N lines of the CURRENT run
-    relevant_lines = relevant_lines[-10:]
+    relevant_lines = relevant_lines[-50:]
     result = {"status": "In Progress"}
     for line in relevant_lines:
         line_lower = line.lower()
@@ -232,6 +247,13 @@
                 "status": "Successful",
                 "completed_at": ts
             }
+    # PID VALIDATION — ONLY AFTER LOG PARSING
+    if result["status"] == "In Progress":
+        if not is_job_really_running(PID_FILE_IMPORT):
+            return {
+                "status": "Failed",
+                "message": "Import operation was interrupted (system reboot or process termination)"
+            }
     return result
 
 
@@ -269,7 +291,7 @@
     # If no marker found, consider entire log
     relevant_lines = lines[start_idx:] if start_idx is not None else lines
     # Only inspect last N lines of the CURRENT run
-    relevant_lines = relevant_lines[-10:]
+    relevant_lines = relevant_lines[-50:]
     result = {"status": "In Progress"}
     for line in relevant_lines:
         line_lower = line.lower()
@@ -290,6 +312,13 @@
                 "status": "Successful",
                 "completed_at": ts
             }
+    # PID VALIDATION — ONLY AFTER LOG PARSING
+    if result["status"] == "In Progress":
+        if not is_job_really_running(PID_FILE_EXPORT):
+            return {
+                "status": "Failed",
+                "message": "Export operation was interrupted (system reboot or process termination)"
+            }
     return result
 
 
