Immich CLI not following ignore glob patterns #1873

Closed
opened 2026-02-05 04:16:44 +03:00 by OVERLORD · 2 comments
Owner

Originally created by @AziaRae on GitHub (Dec 24, 2023).

Originally assigned to: @etnoy on GitHub.

The bug

I am using the Immich CLI to do bulk backups of my photos to my immich instance. According to the documentation, I can use glob patterns to exclude filetypes and directories. However, it not follow the glob patterns after --ignore , but it respects the exclude options for absolute paths. I can see in the progress output that .mp4 and .dng files and images inside **/Screenshots/** are still being uploaded to Immich despite these exclusions in place.

Here is the bash script I made for automation: https://pwpu.imnot.uk/en/p/in1ugu5ujak/r

I'd like to ask for help as to what can be done to make immich cli exclude the directories and filetypes I listed

The OS that Immich Server is running on

Ubuntu 22.04.3 LTS x86_64

Version of Immich Server

v1.91.4

Version of Immich Mobile App

v1.91.0 build.115

Platform with the issue

  • Server
  • Web
  • Mobile

Your docker-compose.yml content

version: "3.8"

#
# WARNING: Make sure to use the docker-compose.yml of the current release:
#
# https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml
#
# The compose file on main may not be compatible with the latest release.
#

name: immich

services:
  immich-server:
    container_name: immich_server
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    command: [ "start.sh", "immich" ]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
        #      - "/home/rinichi/docker_containers/syncthing/st-sync/pictures/@Android:/home/rinichi/docker_containers/immich/media/@Android:ro"
        #      - "/home/rinichi/docker_containers/syncthing/st-sync/pictures/@IMG:/home/rinichi/docker_containers/immich/media/@IMG:ro"
        #      - "/home/rinichi/docker_containers/syncthing/st-sync/pictures/homePics/:/home/rinichi/docker_containers/immich/media/Pictures:ro"
    env_file:
      - .env
    ports:
      - 127.0.0.1:2283:3001
    depends_on:
      - redis
      - database
    restart: unless-stopped

  immich-microservices:
    container_name: immich_microservices
    image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release}
    # extends:
    #   file: hwaccel.yml
    #   service: hwaccel
    command: [ "start.sh", "microservices" ]
    volumes:
      - ${UPLOAD_LOCATION}:/usr/src/app/upload
      - /etc/localtime:/etc/localtime:ro
        #      - "/home/rinichi/docker_containers/syncthing/st-sync/pictures/@Android:/home/rinichi/docker_containers/immich/media/@Android:ro"
        #      - "/home/rinichi/docker_containers/syncthing/st-sync/pictures/@IMG:/home/rinichi/docker_containers/immich/media/@IMG:ro"
        #      - "/home/rinichi/docker_containers/syncthing/st-sync/pictures/homePics/:/home/rinichi/docker_containers/immich/media/Pictures:ro"
    env_file:
      - .env
    depends_on:
      - redis
      - database
    restart: unless-stopped

  immich-machine-learning:
    container_name: immich_machine_learning
    image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release}
    volumes:
      - model-cache:/cache
    env_file:
      - .env
    restart: unless-stopped


  redis:
    container_name: immich_redis
    image: redis:6.2-alpine@sha256:60e49e22fa5706cd8df7d5e0bc50ee9bab7c608039fa653c4d961014237cca46
    restart: unless-stopped

  database:
    container_name: immich_postgres
    image: tensorchord/pgvecto-rs:pg14-v0.1.11
    env_file:
      - .env
    environment:
      POSTGRES_PASSWORD: ${DB_PASSWORD}
      POSTGRES_USER: ${DB_USERNAME}
      POSTGRES_DB: ${DB_DATABASE_NAME}
    volumes:
      - pgdata:/var/lib/postgresql/data
    restart: unless-stopped

volumes:
  pgdata:
  model-cache:

Your .env content

# You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables

# The location where your uploaded files are stored
UPLOAD_LOCATION="/home/rinichi/docker_containers/immich/library"

# The Immich version to use. You can pin this to a specific version like "v1.71.0"
IMMICH_VERSION=release

Reproduction steps

1. Login to your immich instance via `immich login-key https://immich.domain.tld/api <API>`
2. Choose a directory to upload, and run `immich upload --ignore *.mp4 *.dng --recursive /path/to/upload`

Additional information

No response

Originally created by @AziaRae on GitHub (Dec 24, 2023). Originally assigned to: @etnoy on GitHub. ### The bug I am using the [Immich CLI](https://immich.app/docs/features/command-line-interface/) to do bulk backups of my photos to my immich instance. According to the documentation, I can use glob patterns to exclude filetypes and directories. However, it not follow the glob patterns after `--ignore` , but it respects the exclude options for absolute paths. I can see in the progress output that `.mp4` and `.dng` files and images inside `**/Screenshots/**` are still being uploaded to Immich despite these exclusions in place. Here is the bash script I made for automation: https://pwpu.imnot.uk/en/p/in1ugu5ujak/r I'd like to ask for help as to what can be done to make immich cli exclude the directories and filetypes I listed ### The OS that Immich Server is running on Ubuntu 22.04.3 LTS x86_64 ### Version of Immich Server v1.91.4 ### Version of Immich Mobile App v1.91.0 build.115 ### Platform with the issue - [X] Server - [ ] Web - [ ] Mobile ### Your docker-compose.yml content ```YAML version: "3.8" # # WARNING: Make sure to use the docker-compose.yml of the current release: # # https://github.com/immich-app/immich/releases/latest/download/docker-compose.yml # # The compose file on main may not be compatible with the latest release. # name: immich services: immich-server: container_name: immich_server image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} command: [ "start.sh", "immich" ] volumes: - ${UPLOAD_LOCATION}:/usr/src/app/upload - /etc/localtime:/etc/localtime:ro # - "/home/rinichi/docker_containers/syncthing/st-sync/pictures/@Android:/home/rinichi/docker_containers/immich/media/@Android:ro" # - "/home/rinichi/docker_containers/syncthing/st-sync/pictures/@IMG:/home/rinichi/docker_containers/immich/media/@IMG:ro" # - "/home/rinichi/docker_containers/syncthing/st-sync/pictures/homePics/:/home/rinichi/docker_containers/immich/media/Pictures:ro" env_file: - .env ports: - 127.0.0.1:2283:3001 depends_on: - redis - database restart: unless-stopped immich-microservices: container_name: immich_microservices image: ghcr.io/immich-app/immich-server:${IMMICH_VERSION:-release} # extends: # file: hwaccel.yml # service: hwaccel command: [ "start.sh", "microservices" ] volumes: - ${UPLOAD_LOCATION}:/usr/src/app/upload - /etc/localtime:/etc/localtime:ro # - "/home/rinichi/docker_containers/syncthing/st-sync/pictures/@Android:/home/rinichi/docker_containers/immich/media/@Android:ro" # - "/home/rinichi/docker_containers/syncthing/st-sync/pictures/@IMG:/home/rinichi/docker_containers/immich/media/@IMG:ro" # - "/home/rinichi/docker_containers/syncthing/st-sync/pictures/homePics/:/home/rinichi/docker_containers/immich/media/Pictures:ro" env_file: - .env depends_on: - redis - database restart: unless-stopped immich-machine-learning: container_name: immich_machine_learning image: ghcr.io/immich-app/immich-machine-learning:${IMMICH_VERSION:-release} volumes: - model-cache:/cache env_file: - .env restart: unless-stopped redis: container_name: immich_redis image: redis:6.2-alpine@sha256:60e49e22fa5706cd8df7d5e0bc50ee9bab7c608039fa653c4d961014237cca46 restart: unless-stopped database: container_name: immich_postgres image: tensorchord/pgvecto-rs:pg14-v0.1.11 env_file: - .env environment: POSTGRES_PASSWORD: ${DB_PASSWORD} POSTGRES_USER: ${DB_USERNAME} POSTGRES_DB: ${DB_DATABASE_NAME} volumes: - pgdata:/var/lib/postgresql/data restart: unless-stopped volumes: pgdata: model-cache: ``` ### Your .env content ```Shell # You can find documentation for all the supported env variables at https://immich.app/docs/install/environment-variables # The location where your uploaded files are stored UPLOAD_LOCATION="/home/rinichi/docker_containers/immich/library" # The Immich version to use. You can pin this to a specific version like "v1.71.0" IMMICH_VERSION=release ``` ### Reproduction steps ```bash 1. Login to your immich instance via `immich login-key https://immich.domain.tld/api <API>` 2. Choose a directory to upload, and run `immich upload --ignore *.mp4 *.dng --recursive /path/to/upload` ``` ### Additional information _No response_
OVERLORD added the cli label 2026-02-05 04:16:44 +03:00
Author
Owner

@AziaRae commented on GitHub (Dec 24, 2023):

I found a way to fix the issue. Turns out that instead of just *.{file extension}, I should use **/*.{file extension} instead. I haven't found a way to fix the problem with the directories yet tho

@AziaRae commented on GitHub (Dec 24, 2023): I found a way to fix the issue. Turns out that instead of just `*.{file extension}`, I should use `**/*.{file extension}` instead. I haven't found a way to fix the problem with the directories yet tho
Author
Owner

@etnoy commented on GitHub (Jan 4, 2024):

I am not able to replicate this issue, so I'm closing this. Please reopen if this is still an issue

@etnoy commented on GitHub (Jan 4, 2024): I am not able to replicate this issue, so I'm closing this. Please reopen if this is still an issue
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#1873