rsync commands automation [duplicate]
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:
- Execute rsync1
- Display output of rsync1 in the terminal
- Ask confirmation if want to continue rsync2
- Execute rsync2
Can someone help?
scripts rsync automation
New contributor
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.
add a comment |
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:
- Execute rsync1
- Display output of rsync1 in the terminal
- Ask confirmation if want to continue rsync2
- Execute rsync2
Can someone help?
scripts rsync automation
New contributor
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.
add a comment |
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:
- Execute rsync1
- Display output of rsync1 in the terminal
- Ask confirmation if want to continue rsync2
- Execute rsync2
Can someone help?
scripts rsync automation
New contributor
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:
- Execute rsync1
- Display output of rsync1 in the terminal
- Ask confirmation if want to continue rsync2
- 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
scripts rsync automation
New contributor
New contributor
edited Jan 8 at 14:31
PerlDuck
5,61911231
5,61911231
New contributor
asked Jan 8 at 14:26
XYZXYZ
1
1
New contributor
New contributor
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.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
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
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
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
add a comment |
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
add a comment |
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
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
answered Jan 8 at 14:37
Eric MintzEric Mintz
584112
584112
add a comment |
add a comment |