Re: A strange problem with my daily backups performed via rsync

2020-11-02 Thread Wayne Davison via rsync
On Mon, Nov 2, 2020 at 3:03 AM Manish Jain wrote:

> rsync -av --delete src dst  # but protect dir dst/XYZ from deletion
>
> I tried "--filter 'protect dst/XYZ'" but that does not prevent the
> directory dst/XYZ from being deleted.
>

The "dst" dir isn't in the transfer, so it can't appear in a filter rule*.
If you really specified "src" instead of "src/" (with a trailing slash)
there's no way rsync would ever delete dst/XYZ since it's putting all files
into dst/src. You could protect dst/src/XYZ using a filter of "protect
/src/XYZ/" (the leading slash makes it match at the top of the transer, and
the trailing slash makes it match only a dir).  If you're actually copying
"src/" then you would "protect /XYZ/" (you should always match the names
you see in the transfer's verbose output).

*: Note that you could alternately specify an absolute filter rule such as
--filter "P/ /mnt/dst/XYZ/" since the "/" qualifier to the protect makes it
match an absolute  pathname.  Those rules are slightly less efficient than
matching transfer paths since rsync has to convert the name before it can
compare it, but that tends to not be a big deal for most transfers.

..wayne..
-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: A strange problem with my daily backups performed via rsync

2020-11-02 Thread Manish Jain via rsync

Problem solved.

But I would like to know for my own sake if --delete can be made to work 
while preventing a certain directory from deletion in the backup :


rsync -av --delete src dst  # but protect dir dst/XYZ from deletion

I tried "--filter 'protect dst/XYZ'" but that does not prevent the 
directory dst/XYZ from being deleted.



Thanks for your reply,
Manish Jain


On 2020-11-02 15:08, Kevin Korb via rsync wrote:

A few things here...
What filesystem is on /mnt/sony?
Add a --itemize-changes to see what it says is going on.
There really isn't a good reason to exclude lost+found. It should always
be empty and take up no space.  If there is something in it that is a
sign that there is a problem with your filesystem and you may as well
have rsync bring it to your attention.

On 11/2/20 3:30 AM, Manish Jain via rsync wrote:


Hi,

I am facing a strange situation with my daily backups performed via
rsync. I primarily use Manjaro KDE Linux (LTS kernel), but also have
FreeBSD and Windows 10 bare-metal installations.

I have an all-OS-writable ext2 partition /dev/sda2 mounted at /mnt/wall

My USB backup device is a Sony SSD mounted at /mnt/sony

This is the relevant line from my script which backs up /mnt/wall :

rsync -aAHXv --delete \
--exclude "lost+found" --exclude "System Volume Information" \
/mnt/wall /mnt/sony/

Whenever the line above goes into action, it recursively deletes
/mnt/sony/wall and then copies /mnt/wall all over again.

Any ideas why this might be happening ? Since /mnt/wall is 13GB, it
costs me time and SSD-wear to have /mnt/sony/wall recreated all over
again every time I do a backup.


Thanks,
Manish Jain





--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: A strange problem with my daily backups performed via rsync

2020-11-02 Thread Manish Jain via rsync

/mnt/sony is ext4. /mnt/wall is ext2.

I think I have spotted the problem. Let me try and work this out myself 
now. If the problem persists, I will post again.



Thanks for your reply,
Manish Jain


On 2020-11-02 15:08, Kevin Korb via rsync wrote:

A few things here...
What filesystem is on /mnt/sony?
Add a --itemize-changes to see what it says is going on.
There really isn't a good reason to exclude lost+found. It should always
be empty and take up no space.  If there is something in it that is a
sign that there is a problem with your filesystem and you may as well
have rsync bring it to your attention.

On 11/2/20 3:30 AM, Manish Jain via rsync wrote:


Hi,

I am facing a strange situation with my daily backups performed via
rsync. I primarily use Manjaro KDE Linux (LTS kernel), but also have
FreeBSD and Windows 10 bare-metal installations.

I have an all-OS-writable ext2 partition /dev/sda2 mounted at /mnt/wall

My USB backup device is a Sony SSD mounted at /mnt/sony

This is the relevant line from my script which backs up /mnt/wall :

rsync -aAHXv --delete \
--exclude "lost+found" --exclude "System Volume Information" \
/mnt/wall /mnt/sony/

Whenever the line above goes into action, it recursively deletes
/mnt/sony/wall and then copies /mnt/wall all over again.

Any ideas why this might be happening ? Since /mnt/wall is 13GB, it
costs me time and SSD-wear to have /mnt/sony/wall recreated all over
again every time I do a backup.


Thanks,
Manish Jain





--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: A strange problem with my daily backups performed via rsync

2020-11-02 Thread Kevin Korb via rsync
A few things here...
What filesystem is on /mnt/sony?
Add a --itemize-changes to see what it says is going on.
There really isn't a good reason to exclude lost+found. It should always
be empty and take up no space.  If there is something in it that is a
sign that there is a problem with your filesystem and you may as well
have rsync bring it to your attention.

On 11/2/20 3:30 AM, Manish Jain via rsync wrote:
> 
> Hi,
> 
> I am facing a strange situation with my daily backups performed via
> rsync. I primarily use Manjaro KDE Linux (LTS kernel), but also have
> FreeBSD and Windows 10 bare-metal installations.
> 
> I have an all-OS-writable ext2 partition /dev/sda2 mounted at /mnt/wall
> 
> My USB backup device is a Sony SSD mounted at /mnt/sony
> 
> This is the relevant line from my script which backs up /mnt/wall :
> 
> rsync -aAHXv --delete \
> --exclude "lost+found" --exclude "System Volume Information" \
> /mnt/wall /mnt/sony/
> 
> Whenever the line above goes into action, it recursively deletes
> /mnt/sony/wall and then copies /mnt/wall all over again.
> 
> Any ideas why this might be happening ? Since /mnt/wall is 13GB, it
> costs me time and SSD-wear to have /mnt/sony/wall recreated all over
> again every time I do a backup.
> 
> 
> Thanks,
> Manish Jain
> 

-- 
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,
Kevin Korb  Phone:(407) 252-6853
Systems Administrator   Internet:
FutureQuest, Inc.   ke...@futurequest.net  (work)
Orlando, Floridak...@sanitarium.net (personal)
Web page:   https://sanitarium.net/
PGP public key available on web site.
~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,

-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


A strange problem with my daily backups performed via rsync

2020-11-02 Thread Manish Jain via rsync



Hi,

I am facing a strange situation with my daily backups performed via 
rsync. I primarily use Manjaro KDE Linux (LTS kernel), but also have 
FreeBSD and Windows 10 bare-metal installations.


I have an all-OS-writable ext2 partition /dev/sda2 mounted at /mnt/wall

My USB backup device is a Sony SSD mounted at /mnt/sony

This is the relevant line from my script which backs up /mnt/wall :

rsync -aAHXv --delete \
--exclude "lost+found" --exclude "System Volume Information" \
/mnt/wall /mnt/sony/

Whenever the line above goes into action, it recursively deletes 
/mnt/sony/wall and then copies /mnt/wall all over again.


Any ideas why this might be happening ? Since /mnt/wall is 13GB, it 
costs me time and SSD-wear to have /mnt/sony/wall recreated all over 
again every time I do a backup.



Thanks,
Manish Jain

--
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html