logs and tests
This commit is contained in:
10
masync
10
masync
@ -80,8 +80,6 @@ syncexists() {
|
|||||||
feeddeletes() {
|
feeddeletes() {
|
||||||
queuedeletes=~/.syncdir_$1.deletes
|
queuedeletes=~/.syncdir_$1.deletes
|
||||||
snapfile=${SNAPSHOTFILE}$1
|
snapfile=${SNAPSHOTFILE}$1
|
||||||
echo ${snapfile}
|
|
||||||
echo "grep $1 ${SYNCFILE}"
|
|
||||||
grep $1 ${SYNCFILE} | while read hash pid when status localpath remotepath; do
|
grep $1 ${SYNCFILE} | while read hash pid when status localpath remotepath; do
|
||||||
remoterelativepath=$(echo "$remotepath" | cut -d : -f 2)
|
remoterelativepath=$(echo "$remotepath" | cut -d : -f 2)
|
||||||
remotehost=$(echo "$remotepath" | cut -d : -f 1 | cut -d @ -f 2)
|
remotehost=$(echo "$remotepath" | cut -d : -f 1 | cut -d @ -f 2)
|
||||||
@ -93,11 +91,11 @@ feeddeletes() {
|
|||||||
if [[ -e "${path}" ]]; then
|
if [[ -e "${path}" ]]; then
|
||||||
tocheckremotepath=$(echo "${path}" | sed -e "s~${localpath}~${remoterelativepath}~g")
|
tocheckremotepath=$(echo "${path}" | sed -e "s~${localpath}~${remoterelativepath}~g")
|
||||||
if ! grep -Fxq "${tocheckremotepath}" ${remotefiles}; then
|
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}"
|
rm -rf "${path}"
|
||||||
fi
|
fi
|
||||||
else
|
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
|
## if controlled file doesn't exist in local delete it on remote
|
||||||
echo "${path}" | sed -e "s~${localpath}~${remoterelativepath}~g" | tee -a ${queuedeletes}
|
echo "${path}" | sed -e "s~${localpath}~${remoterelativepath}~g" | tee -a ${queuedeletes}
|
||||||
fi
|
fi
|
||||||
@ -131,8 +129,8 @@ startsyncpath() {
|
|||||||
rm -f ${snapshotfile}
|
rm -f ${snapshotfile}
|
||||||
fi
|
fi
|
||||||
## ensure local computer sends eventually new files adding a fake line in the queue
|
## 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 "Add notify dummy action in queue on startsync" >> ${tempqueuefile}
|
||||||
echo -e "Mirrorring ${GREEN}done${ENDCOLOR}"
|
echo -e "Mirrorring ${GREEN}DONE${ENDCOLOR}"
|
||||||
loopsyncpath $1
|
loopsyncpath $1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user