rsync commands automation [duplicate]












0
















This question already has an answer here:




  • Is there any default function/utility to prompt the user for yes/no in a Bash script?

    5 answers




I want to automate multiple rsync commands like below:




  1. Execute rsync1

  2. Display output of rsync1 in the terminal

  3. Ask confirmation if want to continue rsync2

  4. Execute rsync2


Can someone help?










share|improve this question









New contributor




XYZ is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











marked as duplicate by PerlDuck, Kulfy, karel, Charles Green, Eric Carvalho Jan 8 at 18:41


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.




















    0
















    This question already has an answer here:




    • Is there any default function/utility to prompt the user for yes/no in a Bash script?

      5 answers




    I want to automate multiple rsync commands like below:




    1. Execute rsync1

    2. Display output of rsync1 in the terminal

    3. Ask confirmation if want to continue rsync2

    4. Execute rsync2


    Can someone help?










    share|improve this question









    New contributor




    XYZ is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.











    marked as duplicate by PerlDuck, Kulfy, karel, Charles Green, Eric Carvalho Jan 8 at 18:41


    This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


















      0












      0








      0









      This question already has an answer here:




      • Is there any default function/utility to prompt the user for yes/no in a Bash script?

        5 answers




      I want to automate multiple rsync commands like below:




      1. Execute rsync1

      2. Display output of rsync1 in the terminal

      3. Ask confirmation if want to continue rsync2

      4. Execute rsync2


      Can someone help?










      share|improve this question









      New contributor




      XYZ is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.













      This question already has an answer here:




      • Is there any default function/utility to prompt the user for yes/no in a Bash script?

        5 answers




      I want to automate multiple rsync commands like below:




      1. Execute rsync1

      2. Display output of rsync1 in the terminal

      3. Ask confirmation if want to continue rsync2

      4. Execute rsync2


      Can someone help?





      This question already has an answer here:




      • Is there any default function/utility to prompt the user for yes/no in a Bash script?

        5 answers








      scripts rsync automation






      share|improve this question









      New contributor




      XYZ is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      XYZ is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited Jan 8 at 14:31









      PerlDuck

      5,61911231




      5,61911231






      New contributor




      XYZ is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked Jan 8 at 14:26









      XYZXYZ

      1




      1




      New contributor




      XYZ is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      XYZ is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      XYZ is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




      marked as duplicate by PerlDuck, Kulfy, karel, Charles Green, Eric Carvalho Jan 8 at 18:41


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.






      marked as duplicate by PerlDuck, Kulfy, karel, Charles Green, Eric Carvalho Jan 8 at 18:41


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
























          1 Answer
          1






          active

          oldest

          votes


















          2














          Something like this:



          # --progress will show rsync progress in real time
          rsync1 --progress source dest

          read -p "Proceed? [N/y]: " PROCEED

          # default response is "n"
          PROCEED=${PROCEED:-"n"}

          # convert the response to lower case to make it eiser to test
          if [ "${PROCEED,,}" = 'y' ]; then
          echo "Proceeding..."
          else
          echo "Stopping"
          # change to exit 0 if you don't want this to be an error condition
          exit 1
          fi

          rsync2 --progress source dest





          share|improve this answer






























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            2














            Something like this:



            # --progress will show rsync progress in real time
            rsync1 --progress source dest

            read -p "Proceed? [N/y]: " PROCEED

            # default response is "n"
            PROCEED=${PROCEED:-"n"}

            # convert the response to lower case to make it eiser to test
            if [ "${PROCEED,,}" = 'y' ]; then
            echo "Proceeding..."
            else
            echo "Stopping"
            # change to exit 0 if you don't want this to be an error condition
            exit 1
            fi

            rsync2 --progress source dest





            share|improve this answer




























              2














              Something like this:



              # --progress will show rsync progress in real time
              rsync1 --progress source dest

              read -p "Proceed? [N/y]: " PROCEED

              # default response is "n"
              PROCEED=${PROCEED:-"n"}

              # convert the response to lower case to make it eiser to test
              if [ "${PROCEED,,}" = 'y' ]; then
              echo "Proceeding..."
              else
              echo "Stopping"
              # change to exit 0 if you don't want this to be an error condition
              exit 1
              fi

              rsync2 --progress source dest





              share|improve this answer


























                2












                2








                2







                Something like this:



                # --progress will show rsync progress in real time
                rsync1 --progress source dest

                read -p "Proceed? [N/y]: " PROCEED

                # default response is "n"
                PROCEED=${PROCEED:-"n"}

                # convert the response to lower case to make it eiser to test
                if [ "${PROCEED,,}" = 'y' ]; then
                echo "Proceeding..."
                else
                echo "Stopping"
                # change to exit 0 if you don't want this to be an error condition
                exit 1
                fi

                rsync2 --progress source dest





                share|improve this answer













                Something like this:



                # --progress will show rsync progress in real time
                rsync1 --progress source dest

                read -p "Proceed? [N/y]: " PROCEED

                # default response is "n"
                PROCEED=${PROCEED:-"n"}

                # convert the response to lower case to make it eiser to test
                if [ "${PROCEED,,}" = 'y' ]; then
                echo "Proceeding..."
                else
                echo "Stopping"
                # change to exit 0 if you don't want this to be an error condition
                exit 1
                fi

                rsync2 --progress source dest






                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jan 8 at 14:37









                Eric MintzEric Mintz

                584112




                584112















                    Popular posts from this blog

                    數位音樂下載

                    When can things happen in Etherscan, such as the picture below?

                    格利澤436b