> I guess your script which will be executed periodically will be such
> like this (I didn't test it),
> 
> mount -o remount,udba=inotify /aufs
> mv /rw/* /ro/*
> mount -o remount,udba=reval /aufs

This sample was rough or rude.
You may need to care about whiteout, and the possibility of another
process may modify aufs.
Here is a modified sample.
You still need to decide how to handle whiteouts.

----------------------------------------------------------------------
tmp=/rw/.wh..wh.$$
mount -o remount,udba=inotify /aufs
find /rw ! -name '.wh.*' \( -type d -fprintf $tmp.dir '%P\n' -o -fprintf 
$tmp.nondir '%P\n' \)

cd /ro
xargs -r mkdir < $tmp.dir
xargs -ri mv /rw/\{\} \{\} < $tmp.nondir
rm $tmp.*

cd $OLDPWD
mount -o remount,udba=reval /aufs
----------------------------------------------------------------------

Ideally, this script should be executed with locking-out all other
processes.


Junjiro Okajima

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

Reply via email to