File tree Expand file tree Collapse file tree 8 files changed +8
-8
lines changed
Expand file tree Collapse file tree 8 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 7171filepath=" ${dir} /${file} "
7272
7373# Switch container name with id
74- container_id=$( docker ps -f " name=^ ${container} " -q | tail -n1)
74+ container_id=$( docker ps -f " name=${container} " -q | tail -n1)
7575[[ -z " $container_id " ]] && { echo " Container id for $container not found." ; exit 1; }
7676
7777echo " Backup database $database to $filepath ..."
Original file line number Diff line number Diff line change 6565[[ " $target_database " == " $source_database " ]] && { echo ' Parameter -s|source and -t|target cannot be the same' ; exit 1; }
6666
6767# Switch container name with id
68- container_id=$( docker ps -f " name=^ ${container} " -q | tail -n1)
68+ container_id=$( docker ps -f " name=${container} " -q | tail -n1)
6969[[ -z " $container_id " ]] && { echo " Container id for $container not found." ; exit 1; }
7070
7171# Set alias
Original file line number Diff line number Diff line change 5959[[ -z " $modules " ]] && { echo ' Parameter -i|init is empty' ; exit 1; }
6060
6161# Switch container name with id
62- container_id=$( docker ps -f " name=^ ${container} " -q | tail -n1)
62+ container_id=$( docker ps -f " name=${container} " -q | tail -n1)
6363[[ -z " $container_id " ]] && { echo " Container id for $container not found." ; exit 1; }
6464
6565# Init modules on database
Original file line number Diff line number Diff line change 5656[[ " $target_database " == " $source_database " ]] && { echo ' Parameter -s|source and -t|target cannot be the same' ; exit 1; }
5757
5858# Switch container name with id
59- container_id=$( docker ps -f " name=^ ${container} " -q | tail -n1)
59+ container_id=$( docker ps -f " name=${container} " -q | tail -n1)
6060[[ -z " $container_id " ]] && { echo " Container id for $container not found." ; exit 1; }
6161
6262# Set alias
Original file line number Diff line number Diff line change 5555[[ -z " $database " ]] && { echo ' Parameter -d|database is empty' ; exit 1; }
5656
5757# Switch container name with id
58- container_id=$( docker ps -f " name=^ ${container} " -q | tail -n1)
58+ container_id=$( docker ps -f " name=${container} " -q | tail -n1)
5959[[ -z " $container_id " ]] && { echo " Container id for $container not found." ; exit 1; }
6060
6161# Escape quotes
Original file line number Diff line number Diff line change 5454[[ " $target_database " == " $source_database " ]] && { echo ' Parameter -s|source and -t|target cannot be the same' ; exit 1; }
5555
5656# Switch container name with id
57- container_id=$( docker ps -f " name=^ ${container} " -q | tail -n1)
57+ container_id=$( docker ps -f " name=${container} " -q | tail -n1)
5858[[ -z " $container_id " ]] && { echo " Container id for $container not found." ; exit 1; }
5959
6060# Set alias
Original file line number Diff line number Diff line change 5656[[ " $target_database " == " $source_database " ]] && { echo ' Parameter -s|source and -t|target cannot be the same' ; exit 1; }
5757
5858# Switch container name with id
59- container_id=$( docker ps -f " name=^ ${container} " -q | tail -n1)
59+ container_id=$( docker ps -f " name=${container} " -q | tail -n1)
6060[[ -z " $container_id " ]] && { echo " Container id for $container not found." ; exit 1; }
6161
6262# Drop target database
Original file line number Diff line number Diff line change 5353source_version=${source_version:- " $target_version " }
5454
5555# Switch container name with id
56- container_id=$( docker ps -f " name=^ ${container} " -q | tail -n1)
56+ container_id=$( docker ps -f " name=${container} " -q | tail -n1)
5757[[ -z " $container_id " ]] && { echo " Container id for $container not found." ; exit 1; }
5858
5959# Verify the source version is correct
You can’t perform that action at this time.
0 commit comments