On 4/30/07, Mark <[EMAIL PROTECTED]> wrote:
Hi,

I use rsync with such options:

OPTIONS="-a -u -z -v -S --delete-during --ignore-errors \
         -b --backup-dir=${PATH_BACKUP}/${DATE_YESTERDAY} \
         --exclude-from=$IGNORE"

rsync $OPTIONS ${PATH_SRC} \
      ${PATH_BACKUP}/current

Everything works as it should be, deleted files are transfered everyday
to a new catalog, determinated by a variable ${DATE_YESTERDAY}.


But if an empty dir is deleted from ${PATH_SRC}, then it is
accordingly deleted from ${PATH_BACKUP}/current, and don`t appear in
${PATH_BACKUP}/${DATE_YESTERDAY}.

Do you know what to do it to make empty dirs be transferred
to ${PATH_BACKUP}/${DATE_YESTERDAY}?

You could use an extra pass at the beginning to back up all dirs about
to be deleted, whether they are empty or not:

rsync -ni ${OPTIONS} ${PATH_SRC} ${PATH_BACKUP}/current \
   | sed -rne 's#^\*deleting (.*)/$#\1#p' \
   | rsync --out-format='backing up %n' --files-from=- \
       ${OPTIONS} ${PATH_BACKUP}/current ${PATH_BACKUP}/${DATE_YESTERDAY}

Matt
--
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html

Reply via email to