logs and tests

This commit is contained in:
Amber 2022-03-18 17:01:23 +01:00
parent 963bf16a32
commit b98df15ca1
1 changed files with 4 additions and 6 deletions

10
masync
View File

@ -80,8 +80,6 @@ syncexists() {
feeddeletes() {
queuedeletes=~/.syncdir_$1.deletes
snapfile=${SNAPSHOTFILE}$1
echo ${snapfile}
echo "grep $1 ${SYNCFILE}"
grep $1 ${SYNCFILE} | while read hash pid when status localpath remotepath; do
remoterelativepath=$(echo "$remotepath" | cut -d : -f 2)
remotehost=$(echo "$remotepath" | cut -d : -f 1 | cut -d @ -f 2)
@ -93,11 +91,11 @@ feeddeletes() {
if [[ -e "${path}" ]]; then
tocheckremotepath=$(echo "${path}" | sed -e "s~${localpath}~${remoterelativepath}~g")
if ! grep -Fxq "${tocheckremotepath}" ${remotefiles}; then
echo "${tocheckremotepath} not exists in remote remove ${path} in local";
echo -e "${PURPLE}[PURGE]${ENDCOLOR} ${path} in snapshot no longer exists in remote";
rm -rf "${path}"
fi
else
echo "${path} Noexits";
echo -e "${PURPLE}[PURGE]${ENDCOLOR} ${path} in snapshot no longer exists in local, delete in remote";
## if controlled file doesn't exist in local delete it on remote
echo "${path}" | sed -e "s~${localpath}~${remoterelativepath}~g" | tee -a ${queuedeletes}
fi
@ -131,8 +129,8 @@ startsyncpath() {
rm -f ${snapshotfile}
fi
## ensure local computer sends eventually new files adding a fake line in the queue
echo "Add notify dummy action in queue on startsync" | tee -a ${tempqueuefile}
echo -e "Mirrorring ${GREEN}done${ENDCOLOR}"
echo "Add notify dummy action in queue on startsync" >> ${tempqueuefile}
echo -e "Mirrorring ${GREEN}DONE${ENDCOLOR}"
loopsyncpath $1
}