Commit 15907c4a authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

skip rsyncing overlayfs for /tmp /mnt /dev /var /run

parent 3fecbc25
...@@ -4,6 +4,10 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin ...@@ -4,6 +4,10 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin
NAME=overlay_syncd NAME=overlay_syncd
DESC="overlay sync" DESC="overlay sync"
sync_files () {
rsync -av --exclude=mnt --exclude=tmp --exclude=dev --exclude=var --exclude=run /tmp/rootfs.rw/upperdir/ /tmp/rootfs.ro/
}
case "$1" in case "$1" in
start) start)
echo -n "Starting $DESC: " echo -n "Starting $DESC: "
...@@ -14,7 +18,7 @@ case "$1" in ...@@ -14,7 +18,7 @@ case "$1" in
echo "$NAME." echo "$NAME."
if [ -f /tmp/overlay_sync ]; then if [ -f /tmp/overlay_sync ]; then
if [ -d /tmp/rootfs.ro ]; then if [ -d /tmp/rootfs.ro ]; then
rsync -av /tmp/rootfs.rw/upperdir/ /tmp/rootfs.ro/ sync_files
fi fi
fi fi
;; ;;
...@@ -33,7 +37,7 @@ case "$1" in ...@@ -33,7 +37,7 @@ case "$1" in
sync) sync)
if [ -f /tmp/overlay_sync ]; then if [ -f /tmp/overlay_sync ]; then
if [ -d /tmp/rootfs.ro ]; then if [ -d /tmp/rootfs.ro ]; then
rsync -av /tmp/rootfs.rw/upperdir/ /tmp/rootfs.ro/ sync_files
fi fi
fi fi
;; ;;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment