Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switches from md5sum to openssl md5 #8

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
sed -r --> sed -E
-r isn't available in macOS sed, -E is
grigutis committed Nov 25, 2017

Unverified

This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
commit fbbca5396ed0e7122f8a4d17df9cd9b6a2ba5ac7
6 changes: 3 additions & 3 deletions automysqlbackup
Original file line number Diff line number Diff line change
@@ -101,7 +101,7 @@ load_default_config() {

mysql_commands() {
VERSION=`mysql -V | grep -oE "[0-9]+\.[0-9]+\.[0-9]+"`
NODOT_VER=`echo $VERSION | sed -r 's/\.//g'`
NODOT_VER=`echo $VERSION | sed -E 's/\.//g'`
if [ "${CONFIG_mysql_dump_encrypted_login}" = "yes" ]; then
export MYSQLDUMP="mysqldump --login-path=$CONFIG_mysql_dump_login_path"
export MYSQLSHOW="mysqlshow --login-path=$CONFIG_mysql_dump_login_path"
@@ -263,7 +263,7 @@ gzip_compression() {
# @return: (none)
# @deps: (none)
remove_datetimeinfo () {
mv "$1" "$(echo "$1" | sed -re 's/_[0-9]{4}-[0-9]{2}-[0-9]{2}_[0-9]{2}h[0-9]{2}m_(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday|January|February|March|April|May|June|July|August|September|October|November|December|[0-9]{1,2})//g')"
mv "$1" "$(echo "$1" | sed -Ee 's/_[0-9]{4}-[0-9]{2}-[0-9]{2}_[0-9]{2}h[0-9]{2}m_(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday|January|February|March|April|May|June|July|August|September|October|November|December|[0-9]{1,2})//g')"
}
export -f remove_datetimeinfo

@@ -1431,7 +1431,7 @@ add_manifest_entry() {
lock_manifest "$1" || return 1
id="${filename%.@(diff|sql)*}"
id="${id:(-8):8}"
#id="$(echo $filename | sed -re 's/.*_[0-9]{2}h[0-9]{2}m_([^\.]*)\..*/\1/')"
#id="$(echo $filename | sed -Ee 's/.*_[0-9]{2}h[0-9]{2}m_([^\.]*)\..*/\1/')"
md5sum="$(openssl md5 "$filename" | awk '{print $2}')"
if [[ "x$parent_id" = 'x' ]]; then
echo -e "${filename}\tmd5sum\t${md5sum}\tdiff_id\t${id}\trel_id\t0\tdb\t${db}" >> "$1"