Skip to content
This repository has been archived by the owner on Nov 20, 2023. It is now read-only.

[Feature]: Bulk upload through watched folder #18

Open
gdelosre91 opened this issue Sep 4, 2022 · 13 comments
Open

[Feature]: Bulk upload through watched folder #18

gdelosre91 opened this issue Sep 4, 2022 · 13 comments

Comments

@gdelosre91
Copy link

Feature detail

Similar to photoprism, I'd love to be able to drop uploads in a specific watched folder. I'm running immich in a container on one of my servers, and I get images from all sorts of devices that don't necessarily run immich. I can then have a script that pushes these images from other servers to a folder that immich watches for upload.

Platform

Server

@alextran1502
Copy link
Collaborator

This would be called an agent system. I am planning to implement that with immich-app/immich#7

@akoyaxd
Copy link

akoyaxd commented Sep 4, 2022

You also could use a Linux machine for that watched folder an let the cli-tool run regularly via cron.

This could look like this:

0 */15 * * * * docker run -it --rm -v /WATCHED/FOLDER:/import ghcr.io/alextran1502/immich-cli:latest upload --email testuser@email.com --password password --server http://192.168.1.216:2283/api -d /import --yes

@gdelosre91
Copy link
Author

gdelosre91 commented Sep 4, 2022

Thanks! Looking forward to the agent system

I'm giving the import docker container a shot to hold me over until then

@panoti panoti transferred this issue from immich-app/immich Sep 4, 2022
@panoti
Copy link
Contributor

panoti commented Sep 4, 2022

Excuse me, I move this issue to correct repo for tracking.

@gdelosre91
Copy link
Author

I'm now running into an issue where I'm trying to use this command on a folder with 2,750 photos. The command uploads ~ 100 before the process and docker container seem to stop.

@alextran1502
Copy link
Collaborator

Are you using the docker command or the normal cli command?

@gdelosre91
Copy link
Author

I'm using the docker command:
docker run -it --rm -v /media/share/photos/:/import ghcr.io/alextran1502/immich-cli:latest upload --email test@test.com --password pw12344 --server http://192.168.4.32:2283/api -d /import

@gdelosre91
Copy link
Author

It's worth noting that /media/share is a mounted SMB share

@gdelosre91
Copy link
Author

I tried the normal CLI command and it produced this error:

  throw err;
  ^

Error: Cannot find module 'fs/promises'
Require stack:
- /usr/local/lib/node_modules/immich/bin/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
    at Function.Module._load (internal/modules/cjs/loader.js:667:27)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/immich/bin/index.js:48:20)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/usr/local/lib/node_modules/immich/bin/index.js' ]
}

@alextran1502
Copy link
Collaborator

I think it is your node version issue. Can you make sure you are using Node v16 and above?

@gdelosre91
Copy link
Author

gdelosre91 commented Sep 7, 2022 via email

@gdelosre91
Copy link
Author

Bit of a noob here, but is there any way to use a cron job to automate the CLI script? where I get stuck is that i know the script does ask you if you would like to upload now. how you would you automate that?

@gdelosre91
Copy link
Author

Answered my own question by actually reading the documentation lol

I'll append --yes / -y

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants