diff --git a/plugins/contrib/jobs/pg-restore/restore-db.sh b/plugins/contrib/jobs/pg-restore/restore-db.sh index a64675ed65..2078f19ffc 100755 --- a/plugins/contrib/jobs/pg-restore/restore-db.sh +++ b/plugins/contrib/jobs/pg-restore/restore-db.sh @@ -19,7 +19,7 @@ PGPORT=${PGPORT:-5432} MOUNT_PATH=${MOUNT_PATH:-""} if [ -n "$MOUNT_PATH" ]; then FILTER_PATH=${FILTER_PATH:-".*"} - export LATEST=$(ls -1FR | grep -E "[0-9]{4}_[0-9]{2}_[0-9]{2}_${FILTER_PATH}" | sort -r | head -n 1); + export LATEST=$(ls -1FR "$MOUNT_PATH" | grep -E "[0-9]{4}_[0-9]{2}_[0-9]{2}_${FILTER_PATH}" | sort -r | head -n 1); if [[ ${MOUNT_PATH:length-1:1} != "/" ]]; then export MOUNT_PATH="$MOUNT_PATH/" fi @@ -38,7 +38,6 @@ set +e pg_restore \ --dbname "$PGDATABASE" \ --clean --if-exists \ - --exclude-schema=audit \ --no-owner \ --role "$OWNER" \ --no-acl \