v1.
This commit is contained in:
34
run/evo/clear.sh
Executable file
34
run/evo/clear.sh
Executable file
@@ -0,0 +1,34 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# This script cleans all EVO-related directories
|
||||
# It removes all files from products, groups and stores directories
|
||||
|
||||
# Get the directory where this script is located
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
# Load constants and functions
|
||||
source $SCRIPT_DIR/constants.sh
|
||||
source $SCRIPT_DIR/functions.sh
|
||||
|
||||
# Initialize logging system
|
||||
setup_logging
|
||||
|
||||
# Ensure we clean up properly even if script is interrupted
|
||||
trap 'cleanup 1' HUP INT QUIT TERM
|
||||
|
||||
# Begin cleanup process
|
||||
echo "$(timestamp) [INFO] Starting EVO cleanup process" >> "$LOG_FILE"
|
||||
|
||||
# Clean EVO content directories
|
||||
echo "$(timestamp) [INFO] Cleaning EVO directories" >> "$LOG_FILE"
|
||||
# Remove product files
|
||||
echo "$(timestamp) [INFO] Removing product files" >> "$LOG_FILE"
|
||||
echo "rm -f $EVO_PRODUCTS_PATH/*" && rm -rf $EVO_PRODUCTS_PATH/*
|
||||
# Remove group files
|
||||
echo "$(timestamp) [INFO] Removing group files" >> "$LOG_FILE"
|
||||
echo "rm -f $EVO_GROUPS_PATH/*" && rm -rf $EVO_GROUPS_PATH/*
|
||||
# Remove store files
|
||||
echo "$(timestamp) [INFO] Removing store files" >> "$LOG_FILE"
|
||||
echo "rm -rf $EVO_STORES_PATH/*" && rm -rf $EVO_STORES_PATH/*
|
||||
|
||||
echo "$(timestamp) [INFO] EVO cleanup completed successfully" >> "$LOG_FILE"
|
||||
cleanup 0
|
||||
Reference in New Issue
Block a user