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

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

parent 3fecbc25
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -4,6 +4,10 @@ PATH=/sbin:/bin:/usr/sbin:/usr/bin
NAME=overlay_syncd
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
  start)
	echo -n "Starting $DESC: "
@@ -14,7 +18,7 @@ case "$1" in
	echo "$NAME."
	if [ -f /tmp/overlay_sync ]; then 
            if [ -d /tmp/rootfs.ro ]; then
              rsync -av /tmp/rootfs.rw/upperdir/ /tmp/rootfs.ro/
              sync_files
            fi
	fi
	;;
@@ -33,7 +37,7 @@ case "$1" in
  sync)
        if [ -f /tmp/overlay_sync ]; then 
            if [ -d /tmp/rootfs.ro ]; then
              rsync -av /tmp/rootfs.rw/upperdir/ /tmp/rootfs.ro/
              sync_files
            fi
        fi
  ;;