@@ -219,15 +219,22 @@ jobs:
219219 OLD_DIR=${EOS_BASE_PATH}/doc/${WEB_DIR_NAME}_old
220220 FINAL_DIR=${EOS_BASE_PATH}/doc/${WEB_DIR_NAME}
221221
222- # Recursive cleanup function
222+ # Recursive cleanup function that ignores EOS special directories
223223 cleanup_dir() {
224224 local dir="$1"
225225 if xrdfs "${EOS_HOST}" stat "${dir}" >/dev/null 2>&1; then
226226 for f in $(xrdfs "${EOS_HOST}" ls "${dir}" 2>/dev/null); do
227- if xrdfs ${EOS_HOST} stat "$f" 2>/dev/null | grep -q "is a directory"; then
227+ # Skip EOS special directories
228+ if [[ "$f" == *.sys* ]]; then
229+ echo "Skipping special EOS directory: $f"
230+ continue
231+ fi
232+ # Recurse into directories
233+ if xrdfs "${EOS_HOST}" stat "$f" 2>/dev/null | grep -q '^Directory:'; then
228234 cleanup_dir "$f"
229235 else
230- xrdfs ${EOS_HOST} rm "$f" || true
236+ echo "Removing file: $f"
237+ xrdfs "${EOS_HOST}" rm "$f" || true
231238 fi
232239 done
233240 xrdfs "${EOS_HOST}" rmdir "${dir}" || true
@@ -237,20 +244,19 @@ jobs:
237244 # Clean temporary directory
238245 cleanup_dir "${TMP_DIR}"
239246
240- # Upload documentation to temporary directory
247+ # Upload documentation files
241248 cd ${DOC_DIR}/html/
242- xrdcp --parallel 64 -r -f ./*.html ${EOS_ENDPOINT}/${TMP_DIR}/
243- rm -rf *.html
244- xrdcp --parallel 64 -r -f ./*.svg ${EOS_ENDPOINT}/${TMP_DIR}/
245- rm -rf *.svg
246- xrdcp --parallel 64 -r -f ./*.map ${EOS_ENDPOINT}/${TMP_DIR}/
247- rm -rf *.map
248- xrdcp --parallel 64 -r -f ./*.md5 ${EOS_ENDPOINT}/${TMP_DIR}/
249- rm -rf *.md5
250- xrdcp --parallel 64 -r -f ./ ${EOS_ENDPOINT}/${TMP_DIR}/
249+ xrdcp --parallel 64 -f ./*.html ${EOS_ENDPOINT}/${TMP_DIR} || true
250+ xrdcp --parallel 64 -f ./*.svg ${EOS_ENDPOINT}/${TMP_DIR} || true
251+ xrdcp --parallel 64 -f ./*.map ${EOS_ENDPOINT}/${TMP_DIR} || true
252+ xrdcp --parallel 64 -f ./*.md5 ${EOS_ENDPOINT}/${TMP_DIR} || true
253+
254+ # Upload entire folder content
255+ xrdcp --parallel 64 -rf ./ ${EOS_ENDPOINT}/${TMP_DIR}
256+
251257 cd ..
252258 rm -r html
253- xrdcp --parallel 64 -r -f ./ ${EOS_ENDPOINT}/${TMP_DIR}/
259+ xrdcp --parallel 64 -rf ./ ${EOS_ENDPOINT}/${TMP_DIR}
254260 cd ..
255261
256262 # Remove previous backup
@@ -265,5 +271,5 @@ jobs:
265271 # Delete the old directory after successful swap
266272 cleanup_dir "${OLD_DIR}"
267273
268- # Upload tar.gz archive to download directory
269- xrdcp -r - f ${TAR_NAME}.gz ${EOS_ENDPOINT}/${EOS_BASE_PATH}/download/
274+ # Upload tar.gz archive
275+ xrdcp -f ${TAR_NAME}.gz ${EOS_ENDPOINT}/${EOS_BASE_PATH}/download/
0 commit comments