• Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below
  • Forum
  • Website
  • GitHub
  • Status
  • Translation
  • Features
  • Team
  • Rules
  • Help
  • Feeds
User Links
  • Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below

    Useful Links Forum Website GitHub Status Translation Features Team Rules Help Feeds
    Jellyfin Forum Support General Questions Windows's Command Line

     
    • 0 Vote(s) - 0 Average

    Windows's Command Line

    Nast
    Offline

    Junior Member

    Posts: 15
    Threads: 5
    Joined: 2023 Jul
    Reputation: 0
    Country:France
    #1
    2023-07-25, 12:16 PM
    Hello,
    Is there a command to stop the web server or stop jellyfin completely in windows?
    qwerty12
    Offline

    Junior Member

    Posts: 30
    Threads: 0
    Joined: 2023 Jun
    Reputation: 3
    #2
    2023-07-25, 02:28 PM
    Hi,

    One way to do it is this:
    1. Go to http://127.0.0.1:8096/web/index.html#!/apikeys.html and add an API key
    2. Run
      Code:
      curl "http://127.0.0.1:8096/System/Shutdown" -X POST -H "X-Emby-Token: 123456789abcde"


    Replace the host and port if necessary. Replace 123456789abcde with the API key you generated earlier. I think you can authenticate via a username and password instead of generating an API key, but I don't know how, and I think using an API key for this task is better. curl.exe is included with Windows since Windows 10. If it is not present, you can use PowerShell to achieve the same thing:
    Code:
    Invoke-WebRequest -UseBasicParsing -Uri "http://127.0.0.1:8096/System/Shutdown" -Method POST -Headers @{ "X-Emby-Token" = "123456789abcde" }

    Otherwise:

    If, contrary to the Windows installer's recommendation, you installed Jellyfin in service mode, a simple net stop JellyfinServer in an elevated Command Prompt* on the same system where Jellyfin is running should also work.

    If you're using the tray app, a PowerShell script that uses GenerateConsoleCtrlEvent should also work, but that's a long story.

    * Or change the ACL on the Jellyfin service to allow stopping as a normal user - look into sc sdset or System Informer for a GUI


    There might be more ways to do it that I'm unaware of. Avoid taskkill though - Jellyfin doesn't listen for window messages so it will cause unclean Jellyfin shutdowns.
    skribe
    Offline

    Community Moderator

    Posts: 147
    Threads: 0
    Joined: 2023 Jun
    Reputation: 5
    #3
    2023-07-25, 02:32 PM
    I believe that the 10.9 release will include some shutdown and restart improvements to also make this sort of thing easier to accomplish from the dashboard as well.
    wanderman
    Offline

    Junior Member

    Posts: 15
    Threads: 5
    Joined: 2024 May
    Reputation: 0
    Country:Germany
    #4
    2024-05-15, 06:38 PM
    (2023-07-25, 02:28 PM)qwerty12 Wrote:
    Code:
    curl "http://127.0.0.1:8096/System/Shutdown" -X POST -H "X-Emby-Token: 123456789abcde"

    What would the call look like for a startup request ?
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,374
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #5
    2024-05-15, 07:07 PM (This post was last modified: 2024-05-15, 07:08 PM by TheDreadPirate.)
    You cannot start Jellyfin with the same mechanism as the quoted shutdown. The quoted example is sending a command to a running jellyfin instance. You would start jellyfin on the command line simply by invoking jellyfin.exe and providing the appropriate startup options.
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    wanderman
    Offline

    Junior Member

    Posts: 15
    Threads: 5
    Joined: 2024 May
    Reputation: 0
    Country:Germany
    #6
    2024-05-16, 07:24 PM (This post was last modified: 2024-05-16, 07:26 PM by wanderman. Edited 1 time in total.)
    Ok thanks for the response. I was asking as i had problems with my old setup of shutting down the tray exe & jellyfin exe to be able to run a backup task. My old method seems to be broken since 1.9. as im no more able to properly kill both exes, either by normal or forced kill. One of both always keeps running.

    However i found a solution, might help someone in the future. Im running a nightly FreeFileSync Backup for my database, thats why i need jellyfin stopped to not get corrupted files into the backup folder. The following is my Windows batch.

    The Batch as well as FreeFileSync is started by using the Windows Task Scheduler

    Shutdown via api call - short timer while FreeFileSync is running - Restarting

    Code:
    curl "http://192.168.178.71:8096/System/Shutdown" -X POST -H "X-Emby-Token: #####APIKEY####"

    TIMEOUT /T 1140 /NOBREAK

    start C:\"Program Files"\Jellyfin\Server\Jellyfin.exe
    qwerty12
    Offline

    Junior Member

    Posts: 30
    Threads: 0
    Joined: 2023 Jun
    Reputation: 3
    #7
    2024-05-17, 09:45 PM (This post was last modified: 2024-05-17, 09:45 PM by qwerty12.)
    (2024-05-16, 07:24 PM)wanderman Wrote: The Batch as well as FreeFileSync is started by using the Windows Task Scheduler

    The Task Scheduler starts programs with below normal CPU priority by default, BTW. Consider tacking on a /NORMAL somewhere in your start command to have Jellyfin run with a standard CPU priority.
    « Next Oldest | Next Newest »

    Users browsing this thread: 1 Guest(s)


    • View a Printable Version
    • Subscribe to this thread
    Forum Jump:

    Home · Team · Help · Contact
    © Designed by D&D - Powered by MyBB
    L


    Jellyfin

    The Free Software Media System

    Linear Mode
    Threaded Mode