ML
    • Register
    • Login
    • Search
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups

    Timeout in .sh file

    IT Discussion
    5
    50
    1694
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Lakshmana
      Lakshmana last edited by

      I am giving the scenario where the files needs to be downloaded from the Chrome by automatically closing once the download of the file is completed.I am downloading 5 files through .sh file but the Chrome is not closing after download of the file.I have tried opening the new window through terminal but at that time also i need to click on Ctrl+C to download other file.How to use Timeout here ?

      Wget and curl i have tried which gives authentication issue where the files are downloaded from the .sh file.

      chromium-browser "Link1"
      chromium-browser "Link2"
      chromium-browser "Link3"

      Help me !!

      I have the timeout -k 10s which was not working

      1 Reply Last reply Reply Quote 1
      • black3dynamite
        black3dynamite last edited by black3dynamite

        pkill chromium

        https://www.garron.me/en/bits/kill-all-instances-chromium-linux-command-line.html

        Lakshmana 1 Reply Last reply Reply Quote 0
        • black3dynamite
          black3dynamite last edited by

          You can’t use wget or curl download the files?

          scottalanmiller 1 Reply Last reply Reply Quote 1
          • Lakshmana
            Lakshmana @black3dynamite last edited by

            @black3dynamite said in Timeout in .sh file:

            pkill chromium

            https://www.garron.me/en/bits/kill-all-instances-chromium-linux-command-line.html

            While using the chrome is not even starting but the working chrome is being killed

            1 Reply Last reply Reply Quote 0
            • scottalanmiller
              scottalanmiller @black3dynamite last edited by

              @black3dynamite said in Timeout in .sh file:

              You can’t use wget or curl download the files?

              I'd use wget super easy.

              Lakshmana 1 Reply Last reply Reply Quote 0
              • Lakshmana
                Lakshmana @scottalanmiller last edited by

                @scottalanmiller

                @lakshmana said in Timeout in .sh file:

                @black3dynamite said in Timeout in .sh file:

                pkill chromium

                https://www.garron.me/en/bits/kill-all-instances-chromium-linux-command-line.html

                While using the chrome is not even starting but the working chrome is being killed

                We can use but need to give credentials.I need to run without admin credentials

                scottalanmiller 1 Reply Last reply Reply Quote 0
                • scottalanmiller
                  scottalanmiller @Lakshmana last edited by

                  @lakshmana said in Timeout in .sh file:

                  @scottalanmiller

                  @lakshmana said in Timeout in .sh file:

                  @black3dynamite said in Timeout in .sh file:

                  pkill chromium

                  https://www.garron.me/en/bits/kill-all-instances-chromium-linux-command-line.html

                  While using the chrome is not even starting but the working chrome is being killed

                  We can use but need to give credentials.I need to run without admin credentials

                  You can do that with cURL for sure, and I expect wget.

                  Lakshmana 1 Reply Last reply Reply Quote 1
                  • Lakshmana
                    Lakshmana @scottalanmiller last edited by

                    @scottalanmiller said in Timeout in .sh file:

                    @lakshmana said in Timeout in .sh file:

                    @scottalanmiller

                    @lakshmana said in Timeout in .sh file:

                    @black3dynamite said in Timeout in .sh file:

                    pkill chromium

                    https://www.garron.me/en/bits/kill-all-instances-chromium-linux-command-line.html

                    While using the chrome is not even starting but the working chrome is being killed

                    We can use but need to give credentials.I need to run without admin credentials

                    You can do that with cURL for sure, and I expect wget.

                    During using Curl the file is not downloading where the link for that file is created inside the downloaded file

                    scottalanmiller thwr 2 Replies Last reply Reply Quote 0
                    • scottalanmiller
                      scottalanmiller @Lakshmana last edited by

                      @lakshmana said in Timeout in .sh file:

                      @scottalanmiller said in Timeout in .sh file:

                      @lakshmana said in Timeout in .sh file:

                      @scottalanmiller

                      @lakshmana said in Timeout in .sh file:

                      @black3dynamite said in Timeout in .sh file:

                      pkill chromium

                      https://www.garron.me/en/bits/kill-all-instances-chromium-linux-command-line.html

                      While using the chrome is not even starting but the working chrome is being killed

                      We can use but need to give credentials.I need to run without admin credentials

                      You can do that with cURL for sure, and I expect wget.

                      During using Curl the file is not downloading where the link for that file is created inside the downloaded file

                      Are you sending the credentials with cURL?

                      Lakshmana 1 Reply Last reply Reply Quote 0
                      • thwr
                        thwr last edited by thwr

                        I would always use curl / wget / any other CLI tool before I would use Chromium (Chromium != Chrome) for a simple file download. It's a monster in terms of resource consumption.

                        Lakshmana 1 Reply Last reply Reply Quote 0
                        • thwr
                          thwr @Lakshmana last edited by thwr

                          @lakshmana said in Timeout in .sh file:

                          @scottalanmiller said in Timeout in .sh file:

                          @lakshmana said in Timeout in .sh file:

                          @scottalanmiller

                          @lakshmana said in Timeout in .sh file:

                          @black3dynamite said in Timeout in .sh file:

                          pkill chromium

                          https://www.garron.me/en/bits/kill-all-instances-chromium-linux-command-line.html

                          While using the chrome is not even starting but the working chrome is being killed

                          We can use but need to give credentials.I need to run without admin credentials

                          You can do that with cURL for sure, and I expect wget.

                          During using Curl the file is not downloading where the link for that file is created inside the downloaded file

                          Does the download require some kind of a session? E.g. is the download only available after a login?

                          If so, how does the web application know if the user is logged in? Does it rely on some cookie for example (PHPSESSIONID etc?)? You could hand over a copy of that cookie in the request for example.

                          1 Reply Last reply Reply Quote 0
                          • Lakshmana
                            Lakshmana @scottalanmiller last edited by

                            @scottalanmiller said in Timeout in .sh file:

                            @lakshmana said in Timeout in .sh file:

                            @scottalanmiller said in Timeout in .sh file:

                            @lakshmana said in Timeout in .sh file:

                            @scottalanmiller

                            @lakshmana said in Timeout in .sh file:

                            @black3dynamite said in Timeout in .sh file:

                            pkill chromium

                            https://www.garron.me/en/bits/kill-all-instances-chromium-linux-command-line.html

                            While using the chrome is not even starting but the working chrome is being killed

                            We can use but need to give credentials.I need to run without admin credentials

                            You can do that with cURL for sure, and I expect wget.

                            During using Curl the file is not downloading where the link for that file is created inside the downloaded file

                            Are you sending the credentials with cURL?

                            How to do this?

                            black3dynamite 1 Reply Last reply Reply Quote 0
                            • black3dynamite
                              black3dynamite @Lakshmana last edited by

                              @lakshmana said in Timeout in .sh file:

                              @scottalanmiller said in Timeout in .sh file:

                              @lakshmana said in Timeout in .sh file:

                              @scottalanmiller said in Timeout in .sh file:

                              @lakshmana said in Timeout in .sh file:

                              @scottalanmiller

                              @lakshmana said in Timeout in .sh file:

                              @black3dynamite said in Timeout in .sh file:

                              pkill chromium

                              https://www.garron.me/en/bits/kill-all-instances-chromium-linux-command-line.html

                              While using the chrome is not even starting but the working chrome is being killed

                              We can use but need to give credentials.I need to run without admin credentials

                              You can do that with cURL for sure, and I expect wget.

                              During using Curl the file is not downloading where the link for that file is created inside the downloaded file

                              Are you sending the credentials with cURL?

                              How to do this?

                              https://www.cyberciti.biz/faq/curl-download-file-example-under-linux-unix/
                              curl http://username:[email protected]/file/path/data.tar.gz
                              or
                              curl -u Username:Password http://server1.cyberciti.biz/file/path/data.tar.gz

                              Lakshmana 1 Reply Last reply Reply Quote 0
                              • Lakshmana
                                Lakshmana @thwr last edited by

                                @thwr said in Timeout in .sh file:

                                I would always use curl / wget / any other CLI tool before I would use Chromium (Chromium != Chrome) for a simple file download. It's a monster in terms of resource consumption.

                                I tried wget where credentials is asking and in curl the file is not downloading where the test file created inside that file the link is there to download the file.So only using Chrome here

                                scottalanmiller stacksofplates 2 Replies Last reply Reply Quote 0
                                • Lakshmana
                                  Lakshmana @black3dynamite last edited by

                                  @black3dynamite said in Timeout in .sh file:

                                  @lakshmana said in Timeout in .sh file:

                                  @scottalanmiller said in Timeout in .sh file:

                                  @lakshmana said in Timeout in .sh file:

                                  @scottalanmiller said in Timeout in .sh file:

                                  @lakshmana said in Timeout in .sh file:

                                  @scottalanmiller

                                  @lakshmana said in Timeout in .sh file:

                                  @black3dynamite said in Timeout in .sh file:

                                  pkill chromium

                                  https://www.garron.me/en/bits/kill-all-instances-chromium-linux-command-line.html

                                  While using the chrome is not even starting but the working chrome is being killed

                                  We can use but need to give credentials.I need to run without admin credentials

                                  You can do that with cURL for sure, and I expect wget.

                                  During using Curl the file is not downloading where the link for that file is created inside the downloaded file

                                  Are you sending the credentials with cURL?

                                  How to do this?

                                  https://www.cyberciti.biz/faq/curl-download-file-example-under-linux-unix/
                                  curl http://username:[email protected]/file/path/data.tar.gz
                                  or
                                  curl -u Username:Password http://server1.cyberciti.biz/file/path/data.tar.gz

                                  This .sh file will be running in my colleague System also at that time credentials cannot be shown right! So only going for Chrome

                                  thwr 1 Reply Last reply Reply Quote 0
                                  • thwr
                                    thwr @Lakshmana last edited by thwr

                                    @lakshmana said in Timeout in .sh file:

                                    @black3dynamite said in Timeout in .sh file:

                                    @lakshmana said in Timeout in .sh file:

                                    @scottalanmiller said in Timeout in .sh file:

                                    @lakshmana said in Timeout in .sh file:

                                    @scottalanmiller said in Timeout in .sh file:

                                    @lakshmana said in Timeout in .sh file:

                                    @scottalanmiller

                                    @lakshmana said in Timeout in .sh file:

                                    @black3dynamite said in Timeout in .sh file:

                                    pkill chromium

                                    https://www.garron.me/en/bits/kill-all-instances-chromium-linux-command-line.html

                                    While using the chrome is not even starting but the working chrome is being killed

                                    We can use but need to give credentials.I need to run without admin credentials

                                    You can do that with cURL for sure, and I expect wget.

                                    During using Curl the file is not downloading where the link for that file is created inside the downloaded file

                                    Are you sending the credentials with cURL?

                                    How to do this?

                                    https://www.cyberciti.biz/faq/curl-download-file-example-under-linux-unix/
                                    curl http://username:[email protected]/file/path/data.tar.gz
                                    or
                                    curl -u Username:Password http://server1.cyberciti.biz/file/path/data.tar.gz

                                    This .sh file will be running in my colleague System also at that time credentials cannot be shown right! So only going for Chrome

                                    There are still better ways. Read the password from a file that can only be read by the user which is invoking the download process. You could pass credentials from stdin or simply use curl's --netrc-file parameter:

                                    curl [your options here] --netrc-file /your/secret/and/not/world/readable/password-file http://some.link/to/the/file
                                    

                                    The password file looks like this:

                                    machine <example.com> login <username> password <password>
                                    

                                    See here for more information: https://stackoverflow.com/a/27894407

                                    I could even think about a encrypted password stored in a file that will be decrypted on the fly using stdin passing - but that's way more advanced stuff.

                                    1 Reply Last reply Reply Quote 0
                                    • scottalanmiller
                                      scottalanmiller @Lakshmana last edited by

                                      @lakshmana said in Timeout in .sh file:

                                      @thwr said in Timeout in .sh file:

                                      I would always use curl / wget / any other CLI tool before I would use Chromium (Chromium != Chrome) for a simple file download. It's a monster in terms of resource consumption.

                                      I tried wget where credentials is asking and in curl the file is not downloading where the test file created inside that file the link is there to download the file.So only using Chrome here

                                      Just because you tried and didn't figure it out doesn't mean it isn't the right solution. You don't have anything working right now, or you'd not need the question. We are trying to get this working in a practical, logical way, and cURL is almost certainly the right way.

                                      Lakshmana 1 Reply Last reply Reply Quote 1
                                      • Lakshmana
                                        Lakshmana @scottalanmiller last edited by

                                        @scottalanmiller said in Timeout in .sh file:

                                        @lakshmana said in Timeout in .sh file:

                                        @thwr said in Timeout in .sh file:

                                        I would always use curl / wget / any other CLI tool before I would use Chromium (Chromium != Chrome) for a simple file download. It's a monster in terms of resource consumption.

                                        I tried wget where credentials is asking and in curl the file is not downloading where the test file created inside that file the link is there to download the file.So only using Chrome here

                                        Just because you tried and didn't figure it out doesn't mean it isn't the right solution. You don't have anything working right now, or you'd not need the question. We are trying to get this working in a practical, logical way, and cURL is almost certainly the right way.

                                        Yes I understood but trying my efforts

                                        1 Reply Last reply Reply Quote 0
                                        • stacksofplates
                                          stacksofplates @Lakshmana last edited by

                                          @lakshmana said in Timeout in .sh file:

                                          @thwr said in Timeout in .sh file:

                                          I would always use curl / wget / any other CLI tool before I would use Chromium (Chromium != Chrome) for a simple file download. It's a monster in terms of resource consumption.

                                          I tried wget where credentials is asking and in curl the file is not downloading where the test file created inside that file the link is there to download the file.So only using Chrome here

                                          Show us the command you ran. I have a feeling you’re either not following a redirect or your output option is not set correctly.

                                          Lakshmana 1 Reply Last reply Reply Quote 1
                                          • Lakshmana
                                            Lakshmana @stacksofplates last edited by

                                            @stacksofplates said in Timeout in .sh file:

                                            @lakshmana said in Timeout in .sh file:

                                            @thwr said in Timeout in .sh file:

                                            I would always use curl / wget / any other CLI tool before I would use Chromium (Chromium != Chrome) for a simple file download. It's a monster in terms of resource consumption.

                                            I tried wget where credentials is asking and in curl the file is not downloading where the test file created inside that file the link is there to download the file.So only using Chrome here

                                            Show us the command you ran. I have a feeling you’re either not following a redirect or your output option is not set correctly.

                                            curl -o "Link"

                                            thwr scottalanmiller 2 Replies Last reply Reply Quote 0
                                            • First post
                                              Last post