Kimmo Hedman via BackupPC-users wrote at about 15:59:27 +0300 on Wednesday, 
August 18, 2021:
 > 
 > Hi, 
 > have been using backuppc like 15 years for simple rsync file backups for 
 > users emails with Linux Maildir. 
 >   
 > But with our "new" backuppc server i made today first restore for mail user 
 > (Maildir/cur) , and it just wiped out of everything that was in that folder, 
 > not nice! Older backuppc server just restore files and keep old ones also... 
 >   
 >  
 >  
 > Contents of file /var/lib/backuppc/pc/XXX/RestoreLOG.0.z, modified 
 > 2021-08-18 11:59:24 
 > Trimming /XXX/jani.salo/Maildir/cur from remoteDir -> /var/vmail/ 
 > Wrote source file list to /var/lib/backuppc/pc/XXX/.rsyncFilesFrom10394: 
 > /XXX/jani.salo/Maildir/cur 
 > Running: /usr/local/bin/rsync_bpc --bpc-top-dir /var/lib/backuppc 
 > --bpc-host-name XXX --bpc-share-name /var/vmail --bpc-bkup-num 97 
 > --bpc-bkup-comp 3 --bpc-bkup-merge 97/3/4 --bpc-attrib-new --bpc-log-level 1 
 > -e /usr/bin/ssh\ -l\ root --rsync-path=/usr/bin/rsync --recursive --super 
 > --protect-args --numeric-ids --perms --owner --group -D --times --links 
 > --hard-links --delete --partial --log-format=log:\ %o\ %i\ %B\ %8U,%8G\ %9l\ 
 > %f%L --stats --files-from=/var/lib/backuppc/pc/XXX/.rsyncFilesFrom10394 / 
 > XXX:/var/vmail/ 
 > This is the rsync child about to exec /usr/local/bin/rsync_bpc 


As you can see, the 'rsync' restore process is sent the '--delete'
flag. From the rsyc man page:

"This  tells  rsync  to delete extraneous
files from the receiving side (ones that aren’t on the sending side),
but only for the directories that are being synchronized"

For backuppc 4.x, this is a default flag set in config.pl under
$Conf{RsyncRestoreArgs}.  If you don't want this behavior, then
comment-out (or delete), the '--delete' line.

You seem to be right in that this does not seem to have been the
default behavior in backuppc 3.x or at least --delete is not listed in
the $Conf{RsyncRestoreArgs} array under 3.x.

@Craig: if my understanding is correct, it may make sense to
either/or:
1. Document the potentially destructive default behavior of the
   --delete flag
2. Warn the user that files on the restore target may be deleted
3. Add an option to the GUI and/or CLI to delete/not-delete
   "extraneous" files (as defined by rsync)


Jeff


_______________________________________________
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List:    https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki:    https://github.com/backuppc/backuppc/wiki
Project: https://backuppc.github.io/backuppc/

Reply via email to