Hi,
I would like to remove in one instruction a folder by using filter size umbral.., how can i don this with rsync or find?
I'd like something like this, but I dont find the way:
rsync -av --delete --max-size=60M Movies/ Movies/
Any idea, thanks a lot.
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
How can I delete big files with rsync?
Re: How can I delete big files with rsync?
Perhaps I could do someting like this.:
cp -alvr Movies/* AllMovies/
cp -alvr Movies/* BigMovies/ && find BigMovies/ -type f -size -60M -exec rm {} \;
cp -alvr Movies/* SmallMovies/ && find BigMovies/ -type f -size +60M -exec rm {} \;
rsync -av --delete SmallMovies/ Movies/ (filter by small size movies)
or
rsync -av --delete BigMovies/ Movies/ (filter by big size movies)
cp -alvr Movies/* AllMovies/
cp -alvr Movies/* BigMovies/ && find BigMovies/ -type f -size -60M -exec rm {} \;
cp -alvr Movies/* SmallMovies/ && find BigMovies/ -type f -size +60M -exec rm {} \;
rsync -av --delete SmallMovies/ Movies/ (filter by small size movies)
or
rsync -av --delete BigMovies/ Movies/ (filter by big size movies)
bester69 wrote:STOP 2030 globalists demons, keep the fight for humanity freedom against NWO...
-
- Posts: 677
- Joined: 2018-05-10 19:34
- Location: Some where out west
- Been thanked: 1 time
Re: How can I delete big files with rsync?
Some search foo maybe : used these key words:
is a very use full command. But off hand I don't know exactly cause I don't exactly understand what you want to do.
I use this :
Sometimes...
Code: Select all
How to remove or delete files when using rsync
AlsoUPDATE
As I find that the delete options are just for TARGET that if some files are removed from source, rsync --delete remove them from TARGET. And the delete option by after and before, as mentioned in its man page:
--delete-before receiver deletes before transfer, not during
Means that:
rsync delete the file from TARGET which are removed from SOURCE.
rsync start syncing files.
--delete-after receiver deletes after transfer, not during
Means that:
rsync start syncing files.
rsync delete the file from TARGET which are removed from SOURCE after syncing.
NOTE: The --delete-{before/after} implement just in TARGET.
Code: Select all
man rsync
I use this :
Code: Select all
rsync [options] SOURCE TARGET
find TARGET -maxdepth 1 -type f -mtime +60 -exec rm -f {} \;
Please Read What we expect you have already Done
Search Engines know a lot, and
"If God had wanted computers to work all the time, He wouldn't have invented RESET buttons"
and
Just say NO to help vampires!
Search Engines know a lot, and
"If God had wanted computers to work all the time, He wouldn't have invented RESET buttons"
and
Just say NO to help vampires!
Re: How can I delete big files with rsync?
Hi, Thanka for answering (we're talking about filtering by size not time )cuckooflew wrote:..
rsync start syncing files.
rsync delete the file from TARGET which are removed from SOURCE after syncing.
NOTE: The --delete-{before/after} implement just in TARGET.
Alsois a very use full command. But off hand I don't know exactly cause I don't exactly understand what you want to do.Code: Select all
man rsync
I use this :Sometimes...Code: Select all
rsync [options] SOURCE TARGET find TARGET -maxdepth 1 -type f -mtime +60 -exec rm -f {} \;
I wanted to make free local disk space for my MEGA movies folder collection... So ,I wanted to keep smaller movies than 40Mbytes and rest of them keep them in server side in a renamed folder VIDS_SERVER...
So, I wanted a rsync --delete with that keeps lower files han 40M for client side folder, and the opposite to rename in side server and take away from syncing in server MEGA side.
I was trying to rsync agains same folder for just applying max-size filter and purge filer bigger than XX size, the idea was this, but i dont know if it can be make it in just one step:
RSYNC --DELETE --MIN-SIZE=50M TARGET/ TARGET/
but using my purposed soltion and working with hardlinks made it :
Smallmoves goes to clien side
Bigmovies goes to server side (outisde sync)
cp -alvr Movies/* AllMovies/
cp -alvr Movies/* BigMovies/ && find BigMovies/ -type f -size -60M -exec rm {} \;
cp -alvr Movies/* SmallMovies/ && find BigMovies/ -type f -size +60M -exec rm {} \;
rsync -av --delete SmallMovies/ Movies/ (filter by small size movies)
or
rsync -av --delete BigMovies/ Movies/ (filter by big size movies)
bester69 wrote:STOP 2030 globalists demons, keep the fight for humanity freedom against NWO...
-
- Posts: 677
- Joined: 2018-05-10 19:34
- Location: Some where out west
- Been thanked: 1 time
Re: How can I delete big files with rsync?
Well if it works, that is what counts
Please Read What we expect you have already Done
Search Engines know a lot, and
"If God had wanted computers to work all the time, He wouldn't have invented RESET buttons"
and
Just say NO to help vampires!
Search Engines know a lot, and
"If God had wanted computers to work all the time, He wouldn't have invented RESET buttons"
and
Just say NO to help vampires!
Re: How can I delete big files with rsync?
I always win, thats what it countscuckooflew wrote:Well if it works, that is what counts
bester69 wrote:STOP 2030 globalists demons, keep the fight for humanity freedom against NWO...