Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update command-line-interface.md #9941

Closed
wants to merge 1 commit into from
Closed

Conversation

BoBBer446
Copy link
Contributor

Add immich upload background runs for large inputs

Add immich upload background runs for large inputs
@bo0tzz
Copy link
Member

bo0tzz commented Jun 2, 2024

I'm not quite sure how I feel about this; if we want to document how to run the cli in the background at all, maybe describing something like tmux might be better?

@BoBBer446
Copy link
Contributor Author

That's right. It could also be a possibility.
I don't know if it's really better or worse. But I think it's good if the user knows how and that he can do this in the background.

I import over 200,000 images, which takes a while and I don't want to leave the computer on for that long (around 14 hours). Besides, the network could break.

By the way, this is my first request, I have no idea how something like this works :D

@bo0tzz
Copy link
Member

bo0tzz commented Jun 2, 2024

Sending the CLI process to the background doesn't do anything for those cases

@BoBBer446
Copy link
Contributor Author

Does that mean this way would be better?

  1. Start a new tmux session:

    tmux new -s immich_upload
  2. Run the immich upload command within the tmux session:

    immich upload /path/to/your/files/ -r
  3. Detach the tmux session:
    Press Ctrl+b followed by d.
    This detaches the session, allowing the process to continue running in the background.

  4. Reattach to the tmux session:

    tmux attach -t immich_upload

The aim should be to be able to switch off and shut down the computer while the import is running

@bo0tzz
Copy link
Member

bo0tzz commented Jun 2, 2024

The aim should be to be able to switch off and shut down the computer while the import is running

None of these approaches will be able to do that, and I'm not aware of any way that will.

@BoBBer446
Copy link
Contributor Author

Are we talking at cross purposes?
If I move the process with nohub or tmux to the background or a new temux, then I can shut down the PC, the server continues to run.

Later, I can go back to my the PC and connect to the server and either move the nohub process to the foreground or look at the tmux. So while I have switched off the PC, the import has continued to run.

If I only do “immich upload” in the terminal and close the PC, the process is also terminated.

So tmux and nohub are able to continue a long upload process in the background. Or am I making a mistake?

@bo0tzz
Copy link
Member

bo0tzz commented Jun 2, 2024

It wasn't clear to me that you were talking about running the cli over ssh. I had understood it as wanting to shut down the system that the CLI was running on. If it's over ssh then tmux is the way to go - in fact, tmux is really nice whenever you're doing anything over ssh cause stuff like connection failures will not mess up your session.

I would suggest just making this a small note. Something like "if you're running the cli on a remote system via ssh, you can use tmux to allow it to run in the background without staying connected"

@jrasm91
Copy link
Contributor

jrasm91 commented Jun 12, 2024

Yeah, I don't think we need any detailed guides here. Running commands in the background is a common, well-known problem. It is worth mentioning via a note, but we can just refer users to other tools/docs for the details, IMO.

@bo0tzz bo0tzz closed this Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants