masync log
This commit is contained in:
parent
799a7078b2
commit
e9082e375f
2
masync
2
masync
|
@ -161,6 +161,7 @@ startsyncpath() {
|
||||||
snapshotfile=$(format ${SNAPSHOTFILE} hash=${localpath_hash})
|
snapshotfile=$(format ${SNAPSHOTFILE} hash=${localpath_hash})
|
||||||
#tempqueuefile=~/.syncdir_${localpath_hash}.queue
|
#tempqueuefile=~/.syncdir_${localpath_hash}.queue
|
||||||
tempqueuefile=$(format ${TMPQUEUEFILE} hash=${localpath_hash})
|
tempqueuefile=$(format ${TMPQUEUEFILE} hash=${localpath_hash})
|
||||||
|
#syncloopfile=$(format ${SYNCLOOPFILE} hash=${localpath_hash})
|
||||||
|
|
||||||
if [ -e ${snapshotfile} ]; then
|
if [ -e ${snapshotfile} ]; then
|
||||||
echo "Founded snapshot file: ${snapshotfile} checking files to remove..."
|
echo "Founded snapshot file: ${snapshotfile} checking files to remove..."
|
||||||
|
@ -169,6 +170,7 @@ 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 -e "${PURPLE}[DUMMY PUSH]${ENDCOLOR} to remote" >> ${syncloopfile}
|
||||||
echo "Startsync DUMMY ACTION" >> ${tempqueuefile}
|
echo "Startsync DUMMY ACTION" >> ${tempqueuefile}
|
||||||
echo -e "${GREEN}DONE${ENDCOLOR}"
|
echo -e "${GREEN}DONE${ENDCOLOR}"
|
||||||
loopsyncpath $1
|
loopsyncpath $1
|
||||||
|
|
|
@ -72,7 +72,7 @@ synccycle() {
|
||||||
while [ $ndeletes -gt 0 ]; do
|
while [ $ndeletes -gt 0 ]; do
|
||||||
echo -e "${PURPLE}[DELETE]${ENDCOLOR} at remote: ${RED}$(head -n $ndeletes ${tmpqueuedeletes} | tr '\n', ' ')${ENDCOLOR}"
|
echo -e "${PURPLE}[DELETE]${ENDCOLOR} at remote: ${RED}$(head -n $ndeletes ${tmpqueuedeletes} | tr '\n', ' ')${ENDCOLOR}"
|
||||||
ssh $REMOTEHOST "rm -rf $(head -n $ndeletes ${tmpqueuedeletes} | tr '\n', ' ')"
|
ssh $REMOTEHOST "rm -rf $(head -n $ndeletes ${tmpqueuedeletes} | tr '\n', ' ')"
|
||||||
echo -e " ${PURPLE}[DONE]${ENDCOLOR}"
|
echo -e "${PURPLE}[DONE]${ENDCOLOR}"
|
||||||
# remove the first ndeletes lines
|
# remove the first ndeletes lines
|
||||||
flock $lock_deletes
|
flock $lock_deletes
|
||||||
tmpfile=$(mktemp)
|
tmpfile=$(mktemp)
|
||||||
|
@ -90,7 +90,7 @@ synccycle() {
|
||||||
while [ $nqueue -gt 0 ]; do
|
while [ $nqueue -gt 0 ]; do
|
||||||
#echo "${tmpqueuefile} not empty consume ${nqueue} updates in queue"
|
#echo "${tmpqueuefile} not empty consume ${nqueue} updates in queue"
|
||||||
sync $LOCALPATH_HASH $LOCALPATH $REMOTEPATH
|
sync $LOCALPATH_HASH $LOCALPATH $REMOTEPATH
|
||||||
echo -e "${PURPLE}[DONE]${ENDCOLOR}"
|
echo -e "${PURPLE}[PUSH DONE]${ENDCOLOR}"
|
||||||
# remove the first nqueue lines from queue
|
# remove the first nqueue lines from queue
|
||||||
flock $lock_queue
|
flock $lock_queue
|
||||||
tmpfile=$(mktemp)
|
tmpfile=$(mktemp)
|
||||||
|
|
Loading…
Reference in New Issue