Getting --delete to work, simply
kmk at sanitarium.net
Thu May 3 05:09:30 UTC 2018
--delete only works when you sync a dir not individual files. So...
rsync -vai --delete --include='g*' --include='G*' --exclude='*'
On 05/03/2018 12:08 AM, Mike Brown via rsync wrote:
> rsync version 3.1.2 protocol version 31
> I've run into an issue using rsync on my QNAP NAS. I've installed Entware-ng
> on the NAS so that I can install better versions of programs, rsync being
> one of them.
> But, I've run into an issue wqith using the --delete option, as it has
> problems using wildcards.
> Initially a backup script looked like:
> for d in /share/Public/videos/[Gg]*
> rsync -av --delete $d /share/Backup-HDD-03
> I've discovered that any directory that starts with "A", or "a" that is on
> the backup disk that is no longer on the source disk is not getting deleted.
> In order to only back up directories/files that start with "G", or "g",
> required a script that looks like:
> pushd /share/Public/videos
> ls -d [0-9A-FH-Za-fh-z]* > /share/homes/admin/bin/backup_exclude_list
> echo "lost+found" >> /share/homes/admin/bin/backup_exclude_list
> for d in .
> rsync -av --delete --exclude-from=/share/homes/admin/bin/backup_exclude_list \
> $d /share/Backup-HDD-03
> There has to be a much simplier script, or is this really it?
> Thanks for any tips.
Kevin Korb Phone: (407) 252-6853
Systems Administrator Internet:
FutureQuest, Inc. Kevin at FutureQuest.net (work)
Orlando, Florida kmk at sanitarium.net (personal)
Web page: https://sanitarium.net/
PGP public key available on web site.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 195 bytes
Desc: OpenPGP digital signature
More information about the rsync