diff options
author | Christos.K <freedomrfox@gmail.com> | 2017-08-26 15:11:10 +0300 |
---|---|---|
committer | Christos.K <freedomrfox@gmail.com> | 2017-08-26 15:11:10 +0300 |
commit | 28badb75b5d6127aba02be96f553b94be760701b (patch) | |
tree | eed36efa2b2081da9adaeac8c43db7aa2277a80b | |
parent | Changed rsync transfer to hash check instead (diff) | |
download | GSE-28badb75b5d6127aba02be96f553b94be760701b.tar.gz GSE-28badb75b5d6127aba02be96f553b94be760701b.tar.bz2 GSE-28badb75b5d6127aba02be96f553b94be760701b.zip |
Moved backup sync to cinit_pre-mount.sh
-rwxr-xr-x | config.d/controller/modules/functions/ct_prelim.sh | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/config.d/controller/modules/functions/ct_prelim.sh b/config.d/controller/modules/functions/ct_prelim.sh index 16ffbda..4db040b 100755 --- a/config.d/controller/modules/functions/ct_prelim.sh +++ b/config.d/controller/modules/functions/ct_prelim.sh @@ -112,9 +112,12 @@ _mount_target() { unset _fscheck + echo "Attempting to mount $3 at $1" if eval mount -t "$2" -o rw -L "$3" "$1"; then + echo "Mounted successfully" return 0 else + echo "Failed mounting" return 1 fi } @@ -144,7 +147,7 @@ _mount_pseudos() { } _sync_backupfs() { - if rsync -aAXrhq --exclude={"/proc","/dev","/sys"} "/mnt/rfs/" "/mnt/bfs/"; then + if rsync -aAXrhqc --exclude={"/proc","/dev","/sys"} "/mnt/rfs/" "/mnt/bfs/" --delete; then mkdir -p "/mnt/bfs/proc" mkdir -p "/mnt/bfs/sys" mkdir -p "/mnt/bfs/dev" @@ -206,16 +209,21 @@ _check_rbfs() { unset _rfs_check unset _bfs_check - # SYNC SYSFS TO BACKUPFS - if [[ "${_ctflag_setup}" == 2 ]]; then - _sync_backupfs - fi - _unmount "/mnt/rfs" _unmount "/mnt/bfs" _unmount "/mnt/workdir" } +_sync_targets() { + _mount_target "/mnt/rfs" "${SYSFS}" "SYSFS" + _mount_target "/mnt/bfs" "${BACKUPFS}" "BACKUPFS" + + _sync_backupfs + + _unmount "/mnt/rfs" + _unmount "/mnt/bfs" +} + _unset_ct() { unset _ctflag_switch unset _ctflag_net |