# Parse resync string
if [ -n "${SNAP_RESYNC_STRING}" ]
then
- SNAP_COW=$(echo "${SNAP_RESYNC_STRING}" | cut -f1 -d ':')
+ SNAP_COW=$(echo "${SNAP_RESYNC_STRING/\/root/${DEF_SNAP_COW}}" | cut -f1 -d ':')
SNAP_DEV=$(echo "${SNAP_RESYNC_STRING}" | cut -f2 -d ':')
SNAP_MNT=$(echo "${SNAP_RESYNC_STRING}" | cut -f3 -d ':')
DEST="${MOUNTP}/${SNAP_MNT}"
if [ -e "${entry}" ] || [ -L "${entry}" ]
then
- if [ -e "${DEF_SNAP_COW}/${entry}" ] || [ -L "${DEF_SNAP_COW}/${entry}" ]
+ if [ -e "${SNAP_COW}/${entry}" ] || [ -L "${SNAP_COW}/${entry}" ]
then
return 0
fi
Do_filelist ()
{
- # BUGS: supports only cpio.gz types, and does not handle deleted files yet
-
+ # BUGS: does not handle deleted files yet
TMP_FILELIST=$1
+
if [ -f "${SNAP_LIST}" ]
then
+ # if SNAP_COW == /live/cow/home, SNAP_RW = /home
+ SNAP_RW="${SNAP_COW/${DEF_SNAP_COW}}"
+ if [ -z "${SNAP_RW}" ]
+ then
+ SNAP_RW="/"
+ fi
+
+ cd "${SNAP_RW}"
# Generate include list removing empty and commented lines
- for entry in $(sed -e '/^ *$/d' -e '/^#.*$/d' "${SNAP_LIST}")
+ # and transforming paths to relatives
+ for entry in $(sed -e '/^ *$/d' -e '/^#.*$/d' -e 's#^.*$#./&#' -e 's#/\+#/#g' "${SNAP_LIST}")
do
if [ -d "${entry}" ]
then
- cd /
find "${entry}" | while read line
do
if Entry_is_modified "${line}"
printf "%s\000" "${line}" >> "${TMP_FILELIST}"
fi
done
- cd "${OLDPWD}"
elif Entry_is_modified "${entry}"
then
# if file exists and it is modified
printf "%s\000" "${entry}" >> "${TMP_FILELIST}"
fi
done
+ cd "${OLDPWD}"
- if [ "${SNAP_COW}" = "${DEF_SNAP_COW}" ]
- then
- # Relative to rootfs
- echo "/"
- else
- # Mostly "/home"
- echo "${SNAP_COW}"
- fi
+ # echo Working dir
+ echo "${SNAP_RW}"
else
cd "${SNAP_COW}"
+ # removing whiteouts from list
find . -path '*.wh.*' -prune -o -print0 >> "${TMP_FILELIST}"
cd "${OLDPWD}"
+ # echo Working dir
echo "${SNAP_COW}"
fi
}
#
# The syntax for the line is just a full file or directory pathname.
# Those files and directories, and only those will be included on automatic persistence handling.
+#
+# Note that in home-sn snapshot all those paths are treated as relative to /home
# Include itself for reuse
/etc/live-snapshot.list
/etc/live-snapshot.list
-This optional file, if present changes the behaviour of live-snapshot, only files and directories listed there are included (integrally) in the snapshot. It works only for cpio targets.
+This optional file, if present changes the behaviour of live-snapshot, only files and directories listed there are included (integrally) in the snapshot. It works only for cpio and whole partition targets.
/etc/live-snapshot.exclude_list
This optional file, if present will filter the files that will be saved by live-snapshot removing (as in "grep -F -v") all filenames that will be matched by strings listed in it.
-It works for cpio and squashfs snapshot types only; it is pretty useful for filtering temporary files and disk caches.
+It works for cpio, whole partition and squashfs snapshot types only; it is pretty useful for filtering temporary files and disk caches.
See also
/etc/live-snapshot.list
Facoltativo, se presente cambia completamente il funzionamento di live-snapshot; solo i files e le directory elencate verranno effettivamente inclusi nello snapshot.
-Funziona attualmente solo con gli snapshot di tipo "cpio".
+Funziona attualmente solo con gli snapshot di tipo "cpio" e "partizione intera".
/etc/live-snapshot.exclude_list
Facoltativo, se presente verrà utilizzato per filtrare i file da includere negli snapshot. Tutte i file che conterranno le stringhe elecate (come "grep -F -v") non verranno salvati da live-snapshot.
-Funziona attualmente solo con gli snapshot di tipo "cpio" e "squashfs"; è utile per filtrare contenuti poco significativi come i file temporanei e la cache.
+Funziona attualmente solo con gli snapshot di tipo "cpio", "partizione intera" e "squashfs"; è utile per filtrare contenuti poco significativi come i file temporanei e la cache.
See also
--------