From 9cc1d70c832cdf4826883597ed7e418aa5639ae9 Mon Sep 17 00:00:00 2001 From: cschantz Date: Thu, 6 Nov 2025 16:06:35 -0500 Subject: [PATCH] Use toolkit downloads folder instead of /tmp or /root Better approach per user suggestion: - Downloads to: /root/server-toolkit/downloads/acronis-install-YYYYMMDD-HHMMSS/ - Keeps toolkit directory organized - Avoids polluting /root - Avoids /tmp noexec issues - Added downloads/ to .gitignore - Cleanup removes timestamped installation directory after completion Benefits: - All downloads in one place - Easy to find if debugging needed - Cleaner than scattered in /root - Still allows execution (not in /tmp) --- .gitignore | 1 + modules/backup/acronis-install.sh | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.gitignore b/.gitignore index fac143e..a30c255 100644 --- a/.gitignore +++ b/.gitignore @@ -54,3 +54,4 @@ id_ed25519.pub # Config files that might contain sensitive data config.local.* *.credentials +downloads/ diff --git a/modules/backup/acronis-install.sh b/modules/backup/acronis-install.sh index 0602918..4d2cbc6 100755 --- a/modules/backup/acronis-install.sh +++ b/modules/backup/acronis-install.sh @@ -226,10 +226,15 @@ echo "" echo -e "${BOLD}Starting Installation...${NC}" echo "" -# Create temp directory (not in /tmp as it may have noexec) -TEMP_DIR="/root/acronis-install-$$" -mkdir -p "$TEMP_DIR" -cd "$TEMP_DIR" || exit 1 +# Create download directory in toolkit folder +DOWNLOAD_DIR="$SCRIPT_DIR/downloads" +mkdir -p "$DOWNLOAD_DIR" +cd "$DOWNLOAD_DIR" || exit 1 + +# Use timestamped subdirectory for this installation +INSTALL_DIR="$DOWNLOAD_DIR/acronis-install-$(date +%Y%m%d-%H%M%S)" +mkdir -p "$INSTALL_DIR" +cd "$INSTALL_DIR" || exit 1 # Download installer echo "→ Downloading Acronis agent installer..." @@ -348,9 +353,9 @@ else fi # Cleanup -echo "→ Cleaning up temporary files..." -cd / -rm -rf "$TEMP_DIR" +echo "→ Cleaning up installation files..." +cd "$SCRIPT_DIR" +rm -rf "$INSTALL_DIR" echo "" press_enter