diff --git a/scripts/pre_cache.sh b/scripts/pre_cache.sh index 76723c2fb2f40473433ac99c9513e06e8544d78a..d295f4031a280c3c6f5e040846deb3ffdcbed1fa 100755 --- a/scripts/pre_cache.sh +++ b/scripts/pre_cache.sh @@ -12,10 +12,11 @@ function prepopulate { if [[ ! -d $1 ]]; then mkdir -p "$1"; FRESH_CACHE=$(find "/ci-cache/$CI_PROJECT_NAME/$2" -mindepth 2 -maxdepth 2 \ - -type d -name "$CI_JOB_NAME" -not -path "$1" -exec stat --printf="%Y\t%n\n" {} \; |sort -n -r |head -1 |cut -f2); + -type d -name "$CI_JOB_NAME" -not -path "$1" -exec stat --printf="%Y\t%n\n" {} \; \ + |sort -n -r |head -1 |cut -f2); if [[ -d "$FRESH_CACHE" ]]; then echo "____Using" "$FRESH_CACHE" "to prepopulate the cache____"; - time cp -r "$FRESH_CACHE" "$1"; + time cp -rf "$FRESH_CACHE" "$1"; else echo "_____No such $2 dir, proceeding from scratch_____"; fi