immich auto-upload user script


romain

Recommended Posts

I've been able to bulk upload photos to Immich manually through the command line by going to my Docker tab, finding the Immich container, clicking ">_ Console" and running the command:

immich upload --key HFEJ38DNSDUEG --server http://192.168.1.216:2283/api --recursive directory/

This works fine, but I'd like to automate this using userscripts so that it runs automatically from time to time. I don't know much about writing scripts though - I've tried a few things but haven't gotten it to work.

 

If I click the ">_" button at the top of my GUI for the UNRAID terminal, and run:

docker exec -it immich bash

 

I can get into the docker container, so my userscript looks like this:

#!/bin/bash
docker exec -it immich bash
immich upload --key HFEJ38DNSDUEG --server http://192.168.1.216:2283/api --recursive directory/

 

When I run that though I get the error:

Quote

the input device is not a TTY
/tmp/user.scripts/tmpScripts/immich test/script: line 3: immich: command not found

 

I've also tried running:

docker exec -it immich upload --key HFEJ38DNSDUEG --server http://192.168.1.216:2283/api --recursive directory/

but get an error message telling me that the upload command is not found.

 

 

 

 

I'm pasting in the generic 'immich upload' command from the Immich website, the command that I'm running has my correct API key, IP address & upload source directory.

 

 

 

Can anyone suggest a way to set up my user script so that I can run it on a schedule to grab any photos that I put into the upload source directory?

 

 

Another item that I'm concerned about once I get the first part running - when I run the immich upload command through the docker console, there is a message that says something like 'you're about to upload ### photos, are you sure?' and then I have to enter y/n. Is there a way to make sure that the user script can confirm 'y' for me?

 

Edited by romain
added more details.
Link to comment
  • 6 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.