wouterVE/Gitlab-docker-backup-restore

Question "Do you want to to copy the latest file..." results in loop

wouterVE opened this issue · 0 comments

Answer N to this question results in loop: question is being asked again.

if [ -z "$rsync_loc" ]
then
echo "No rsync_loc - pleasy copy backup files manually!";exit 1
else
while true; do
read -rp "Do you want to copy the latest file from backup location? (y/N)" yn
case $yn in
[Yy]* )
webserver_file=$(find $rsync_loc -name "*_webserver*" | tail -n 1)
if [ -z "$webserver_file" ]
then
echo "Error file not found!"; exit 1
else
echo "Copying backup file..."
cp "$webserver_file" "$gl_back_loc"
fi