Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

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

Programming languages, Coding, Executables, Package Creation, and Scripting.
Post Reply
Message
Author
User avatar
bester69
Posts: 2072
Joined: 2015-04-02 13:15
Has thanked: 24 times
Been thanked: 14 times

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

#1 Post by bester69 »

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:STOP 2030 globalists demons, keep the fight for humanity freedom against NWO...

sgosnell
Posts: 975
Joined: 2011-03-14 01:49

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

#2 Post by sgosnell »

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.

User avatar
bester69
Posts: 2072
Joined: 2015-04-02 13:15
Has thanked: 24 times
Been thanked: 14 times

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

#3 Post by bester69 »

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:STOP 2030 globalists demons, keep the fight for humanity freedom against NWO...

sgosnell
Posts: 975
Joined: 2011-03-14 01:49

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

#4 Post by sgosnell »

Why do you care about the file size? Exactly what problem are you trying to solve?
Take my advice, I'm not using it.

User avatar
bester69
Posts: 2072
Joined: 2015-04-02 13:15
Has thanked: 24 times
Been thanked: 14 times

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

#5 Post by bester69 »

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:STOP 2030 globalists demons, keep the fight for humanity freedom against NWO...

sgosnell
Posts: 975
Joined: 2011-03-14 01:49

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

#6 Post by sgosnell »

Then just use max-size. You don't need delete.
Take my advice, I'm not using it.

Post Reply