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

Regression due to commit : code cleanups for incremental patches #395

Closed
Florent38 opened this issue Apr 22, 2014 · 1 comment
Closed

Regression due to commit : code cleanups for incremental patches #395

Florent38 opened this issue Apr 22, 2014 · 1 comment
Assignees
Labels
cleanup enhancement Adaptions and new features
Milestone

Comments

@Florent38
Copy link
Contributor

Hi,
Ref commit : ede4097

The integrity check didn't work (BACKUP_INTEGRITY_CHECK option).
This commit removes the set of restorearchive var and this variable is used by /usr/share/rear/verify/NETFS/default/55_check_backup_archive.sh

But the code is strange because before using $restorearchive rear uses $backuparchive which is equals to $restorearchive before this commit.

Take a look at /usr/share/rear/verify/NETFS/default/55_check_backup_archive.sh :

if [[ $BACKUP_INTEGRITY_CHECK =~ ^[yY1] && -f ${backuparchive}.md5 ]] ; then
    if [[ ! -f "$(dirname $backuparchive)/backup.splitted" ]]; then
        LogPrint "Checking integrity of $(basename $backuparchive) ..."
        (cd $(dirname $restorearchive) && md5sum -c ${restorearchive}.md5)
        StopIfError "Integrity check failed !! \nIf you want to bypass this check please edit the configuration file (/etc/rear/local.conf) and unset BACKUP_INTEGRITY_CHECK."
    fi
fi

I think we need to add again the line remove by the commit, I mean to set $restorearchive.

restorearchive is used by :

grep -rHn "restorearchive" *
prep/NETFS/default/07_set_backup_archive.sh:14:            for i in $(ls ${BUILD_DIR}/outputfs/${NETFS_PREFIX}/*.tar.gz); do restorearchive=$i;done
prep/NETFS/default/07_set_backup_archive.sh:53:               restorearchive="${BUILD_DIR}/outputfs/${NETFS_PREFIX}/${BACKUP_PROG_ARCHIVE}${BACKUP_PROG_SUFFIX}${BACKUP_PROG_COMPRESS_SUFFIX}"
restore/NETFS/default/40_restore_backup.sh:26:Log "Restoring $BACKUP_PROG archive '$restorearchive'"
restore/NETFS/default/40_restore_backup.sh:27:Print "Restoring from '$restorearchive'"
restore/NETFS/default/40_restore_backup.sh:43:                  LAST="$restorearchive"
restore/NETFS/default/40_restore_backup.sh:44:                  BASE=$(dirname "$restorearchive")/$(tar --test-label -f "$restorearchive")
verify/NETFS/default/07_set_backup_archive.sh:14:            for i in $(ls ${BUILD_DIR}/outputfs/${NETFS_PREFIX}/*.tar.gz); do restorearchive=$i;done
verify/NETFS/default/55_check_backup_archive.sh:11:     backuparchive=$restorearchive
verify/NETFS/default/55_check_backup_archive.sh:22:    du -sh "$restorearchive" | cut -d ' ' -f1 >$TMP_DIR/backuparchive_size
verify/NETFS/default/55_check_backup_archive.sh:32:        (cd $(dirname $restorearchive) && md5sum -c ${restorearchive}.md5)

I did a test with the set of restorearchive in usr/share/rear/verify/NETFS/default/07_set_backup_archive.sh and it's work ! It also fixes "the restoring from empty" :

Restoring from ''
by
Restoring from '/tmp/rear.gYRheoJWSEKHveb/outputfs/node/backup.tar.gz'

if you are agree, I can create a pull request ;)

@gdha gdha added cleanup and removed bug labels Apr 23, 2014
@gdha gdha added this to the Rear v1.16 milestone Apr 23, 2014
@gdha gdha self-assigned this Apr 23, 2014
@gdha
Copy link
Member

gdha commented Apr 23, 2014

Yep - looks a correct statement and needs to be corrected. thanks for the investigation and yes please prepare a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup enhancement Adaptions and new features
Projects
None yet
Development

No branches or pull requests

2 participants