[Solved] rsync --delete --max-size??

Need help with C, C++, perl, python, etc?

[Solved] rsync --delete --max-size??

Postby bester69 » 2020-12-03 22:49

Hi,

Do you know How do i get this:
rsync --delete --max-size=20M /source /target

this, only works once.. when i update max-size, delete option doesnt purge target files bigger or smaller than "max-size"...
Its very strange, it obligates me to delete all target files before i want to sync filtering by size file in order to work properly :shock: ..

Right now, I have it this way working like I would like it..(I had to use hardlinks to prevent all files being copying each time, cos I need a first delete.)
Code: Select all
rm -R "$pathvideoshort/"*
rsync -av --delete --max-size=12M --link-dest="$pathvideos/" "$pathvideos/" "$pathvideoshort/"




Thanks a lot.
Last edited by bester69 on 2020-12-04 00:51, edited 1 time in total.
bester69 wrote:You wont change my mind when I know Im right, Im not an ...
User avatar
bester69
 
Posts: 1871
Joined: 2015-04-02 13:15

Re: rsync --delete --max-size??

Postby sgosnell » 2020-12-03 23:31

Do you believe that --delete affects --max-size? Please read, and try to understand, the fine rsync manual.
Code: Select all
man rsync
Take my advice, I'm not using it.
sgosnell
 
Posts: 974
Joined: 2011-03-14 01:49

Re: rsync --delete --max-size??

Postby bester69 » 2020-12-04 00:50

sgosnell wrote:Do you believe that --delete affects --max-size? Please read, and try to understand, the fine rsync manual.
Code: Select all
man rsync


Ok, i understand.. then we could do following thing.:

Solution Proposed (filtering bigger filesize)
find "$pathvideoshort/" -type f -size "+$size" -exec rm "{}" \;
rsync -av --delete --max-size="$size" "$pathvideos/" "$pathvideoshort/"

Solution Proposed (filtering lower filesize)
find "$pathvideoshort/" -type f -size "-$size" -exec rm "{}" \;
rsync -av --delete --min-size="$size" "$pathvideos/" "$pathvideoshort/"


It was something not easy to view at first look..firt time I gave into this issue.. :shock: :?
bester69 wrote:You wont change my mind when I know Im right, Im not an ...
User avatar
bester69
 
Posts: 1871
Joined: 2015-04-02 13:15

Re: [Solved] rsync --delete --max-size??

Postby sgosnell » 2020-12-04 03:06

Why do you care about the file size? Exactly what problem are you trying to solve?
Take my advice, I'm not using it.
sgosnell
 
Posts: 974
Joined: 2011-03-14 01:49

Re: [Solved] rsync --delete --max-size??

Postby bester69 » 2020-12-04 03:33

sgosnell wrote:Why do you care about the file size? Exactly what problem are you trying to solve?

I wanted to exclude big files vids from my daily borg backup repository...
bester69 wrote:You wont change my mind when I know Im right, Im not an ...
User avatar
bester69
 
Posts: 1871
Joined: 2015-04-02 13:15

Re: [Solved] rsync --delete --max-size??

Postby sgosnell » 2020-12-04 14:19

Then just use max-size. You don't need delete.
Take my advice, I'm not using it.
sgosnell
 
Posts: 974
Joined: 2011-03-14 01:49


Return to Programming

Who is online

Users browsing this forum: No registered users and 4 guests

fashionable