[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

shadow copies con rsync



Ciao a tutti, vorrei implementare le shadow copies di microsoft utilizzando snapshots fatti con rsync. Ho creato un server sambatest con la seguente share:

[testshare]
   comment = Test share folder
   force group="DOMAINTEST\domain users"
   path = /home/samba/testshare
   write list = "@DOMAINTEST\domain users"
   create mask = 0660
   directory mask = 0770
   vfs objects = shadow_copy2
   shadow:snapdir = /home/samba/testshare/.snapshots
   shadow:sort = desc
   shadow:format = @GMT-%Y.%m.%d-%H.%M.%S
   shadow:localtime = yes

poi ho eseguito il seguente script:

#!/bin/bash

# A script to perform incremental backups using rsync

set -o errexit
set -o nounset
set -o pipefail

readonly SOURCE_DIR="/home/samba/testshare"
readonly DEST_MAINPATH="/home/samba/testshare/.snapshots"
#readonly DEST_FOLDER="$(date '+%Y-%m-%d_%H%M%S')"
readonly DEST_FOLDER="$(date +@GMT-%Y.%m.%d-%H.%M.%S)"
readonly BACKUP_PATH="${DEST_MAINPATH}/${DEST_FOLDER}"
readonly LATEST_LINK="latest"
readonly BACKUP_LOG="${BACKUP_PATH}.log"

[ -d "${DEST_MAINPATH}" ] || mkdir -p "${DEST_MAINPATH}"

if [ -L "${DEST_MAINPATH}/${LATEST_LINK}" ]; then
    rsync -av --delete --stats --human-readable \
      --exclude "${DEST_MAINPATH}" \
      "${SOURCE_DIR}/" \
      --link-dest "${DEST_MAINPATH}/${LATEST_LINK}" \
      "${BACKUP_PATH}" | gzip -c > "${BACKUP_LOG}".gz

    rm "${DEST_MAINPATH}/${LATEST_LINK}"
else
    rsync -av --delete --stats --human-readable \
      --exclude "${DEST_MAINPATH}" \
      "${SOURCE_DIR}/" \
      "${BACKUP_PATH}" | gzip -c > "${BACKUP_LOG}".gz
fi

cd "$DEST_MAINPATH" && ln -s "${DEST_FOLDER}" "${LATEST_LINK}"

Quindi ho creato e modifiche un file nella share più volte e tra una modifica e l'altra ho lanciato lo script sopra. Quando vado a guardare da windows sul file modificato le versioni precedenti nelle proprietà del file mi dice che non ci sono versioni disponibili...

Dove sbaglio?

Piviul


Reply to: