2009/3/30 Kim-man 'Punky' TSE <[email protected]>:

> I would try I could have some update on it later this week.  After I tested
> Guido's update and some of my additions.

Hi! Please always consider the last update:

http://bitbucket.org/gderosa/net-appliances/src/tip/voyage/etc/init.d/voyage-sync

Specifically, since rev9, some extra check has been added:

                        # verify that $SYNC_DIR is actually mounted as a
                        # $UNIONFS; otherwise, avoid dangerous over-writings
                        # of $SYNCFS_ROOT/$SYNC_DIR
                        if (mount | grep $SYNC_DIR | grep "type $UNIONFS" > 
/dev/null) ; then
                                echo -n "  Sync'ing $SYNC_DIR to 
$SYNCFS_ROOT$SYNC_DIR ... "
                                rsync $RSYNC_OPTS $SYNC_DIR 
$SYNCFS_ROOT/`dirname $SYNC_DIR`
                                log_action_end_msg $?
                        fi

Think about the following scenario:you've been using AUFS/UNIONFS for
a while and recently you have upgraded the kernel, but forgot to add
aufs support; you also have added to VOYAGE_SYNC_DIRS some directories
with important data; in this scenario, after the first reboot,
mounting of $SYNC_DIR fails, and you get stuck with old $SYNC_DIR
contained in your root partition. After another reboot, new data in
$SYNCFS_ROOT are overwritten by older ones which is definitely not
what you want. That's why an extra check is necessary.

So, just for the first time, when you just added a new directory to
VOYAGE_SYNC_DIR, you will have to manually copy it to  $SYNCFS_ROOT/ .

(Maybe an helper function could be added to
/usr/local/sbin/voyage-sync to do this syncing-without-checking
automatically, but definitely not in /etc/init.d )

-- 
G.

_______________________________________________
Voyage-linux mailing list
[email protected]
http://list.voyage.hk/mailman/listinfo/voyage-linux

Reply via email to