checks size of directory & delete it if its to small

for i in *; do test -d "$i" && ( rclone size "$i" --json -L 2> /dev/null | jq --arg path "$i" 'if .bytes < 57462360 then ( { p: $path , b: .bytes}) else "none" end' | grep -v none | jq -r '.p' | parallel -j3 rclone purge "{}" -v -P ); done
only simple example how to combine rclone & jq
Sample Output
Transferred:              0 / 0 Byte, -, 0 Byte/s, ETA -
Errors:                 1 (retrying may help)   
Deleted:                0 (files), 3 (dirs)
Elapsed time:        14.2sTransferred:                    0 / 0 Byte, -, 0 Byte/s, ETA -
Errors:                 1 (retrying may help)
Deleted:                0 (files), 3 (dirs)
Elapsed time:        14.2s
2021/07/25 11:14:04 Failed to purge: unlinkat /mnt/anime/Anime/Fansub/Basquash! (2009): input/output error

1
By: dbiesecke
2021-07-25 09:16:03

What Others Think

Thanks for the above command help, I was looking for this for a website. I believe some commands are very necessary to know by yourself and this is definitely one of them. One of the website's commands that I found intriguing is: Best orthodontist in Carlsbad Orthodontist Carlsbad Orthodontist in Carlsbad, CA Carlsbad orthodontist Orthodontist in Oceanside, CA Carlsbad Children’s dental care Carlsbad Orthodontics Carlsbad Pediatric Dentistry
Glide009 · 7 weeks and 6 days ago
When listing the contents of a directory utilizing the ls command, you may have seen that the size of the records is almost always 4 kb. I also used many commands for preparing my work records I'm working in a Content Writing Company in Karachi. Tools help us to make the best reports.
manihashah1 · 7 weeks and 6 days ago
A very awesome blog post. We are really grateful for your blog post. You will find a lot of approaches after visiting your post. I was exactly searching for. Thanks for such post and please keep it up. omegle
Robert784 · 7 weeks and 5 days ago
became a searcher,wanting to discover who i was and what made me precise. my view of myself turned into changing. i desired a stable base to start from. i commenced to resist3 stress to behave in ways that i didn’t like any greater,and i used to be delighted by who i in reality become. i got here to feel a good deal extra sure that no one can ever take my region. https://www.getnewreview.com
getnewrevv · 7 weeks and 4 days ago
https://www.getnewreview.com=https://www.getnewreview.com https://www.getnewreview.com=nofollow
getnewrevv · 7 weeks and 4 days ago
how to get sponsored for running [url=https://www.hotarticleshop.com/seo]seo optimization company[/url] ref=https://www.getnewreview.com http://www.getnewreview.com www.getnewreview.com
getnewrevv · 7 weeks and 4 days ago
how to get sponsored for running [url=https://www.hotarticleshop.com/seo]seo optimization company[/url] ref=https://www.getnewreview.com http://www.getnewreview.com www.getnewreview.com
getnewrevv · 7 weeks and 4 days ago
Your site is very sexy http://www.effecthub.com/user/1930635">http://www.effecthub.com/user/1930635 https://myanimelist.net/profile/max_22 https://zeef.com/profile/max22 https://www.ultimate-guitar.com/u/muhammadirfanhaider61 https://www.funadvice.com/muhammadirfanhaider61 https://startupmatcher.com/p/irfanhaider http://qooh.me/irfan45">http://qooh.me/irfan45 https://www.producthunt.com/@muhammad_irfan_haider https://www.flickr.com/people/193204067@N08/ https://www.bonanza.com/users/49139846/profile https://quicklinkr.com/muhammad-irfan/public https://ello.co/muhammadirfan https://seedandspark.com/user/muhammad-irfan-1 https://peatix.com/user/8486857/view https://forums.prosportsdaily.com/member.php?995617-Muhammad-Irfan http://www.mappery.com/user.php?name=Muhammad-irfan">http://www.mappery.com/user.php?name=Muhammad-irfan https://coub.com/ea2d80b9607c29c80e43484ac0e19b6e https://www.thingiverse.com/ali45/designs https://storium.com/user/malik4 https://www.play.fm/muhammad-irfan http://molbiol.ru/forums/index.php?showuser=1186388">http://molbiol.ru/forums/index.php?showuser=1186388 https://notionpress.com/dashboard https://www.vietnamta.vn/profile-75157 https://www.castingcall.club/m/MuhammadIrfan https://sumally.com/muhammadirfanhaider61 https://artmight.com/user/profile/175727 https://hub.docker.com/u/72728 https://guides.co/p/muhammad-irfan-haider https://www.brownbook.net/account/profile/4572291 https://muhammadirfanhaider.contently.com/ https://globalresearchnurses.tghn.org/community/members/421605/ http://bcmoney-mobiletv.com/haider">http://bcmoney-mobiletv.com/haider http://jifficlassified.ca/index.php?page=user&action=pub_profile&id=1122805">http://jifficlassified.ca/index.php?page=user&action=pub_profile&id=1122805 http://shaboxes.com/dashboard/">http://shaboxes.com/dashboard/ https://www.bitsdujour.com/profiles/KiZGIM https://www.diggerslist.com/60b8795f2f94d/about https://www.bitrated.com/irfan https://hamronepalibazar.com/user/profile/210103#.YLiEjbczbIU http://senior-formation.com/index.php?page=user&action=pub_profile&id=1030120">http://senior-formation.com/index.php?page=user&action=pub_profile&id=1030120 https://buzzon.khaleejtimes.com/dashboard/ http://www.lawrence.com/users/72729/">http://www.lawrence.com/users/72729/ https://piqs.de/user/Muhammadirfan/ https://rosphoto.com/users/profile-129908 http://www.divephotoguide.com/user/irfan">http://www.divephotoguide.com/user/irfan https://pubhtml5.com/homepage/pkgb http://ttlink.com/haider92/detail">http://ttlink.com/haider92/detail https://www.mytradezone.com/profile/Stu https://profile.hatena.ne.jp/irfan560/ https://www.guestbook-free.com/books2/dieterbohlen/ https://cults3d.com/en/users/muhammadirfanhaider
irfan45 · 7 weeks and 4 days ago
You Can Also Download Free Software & Mac https://tijacrack.com/dlc-boot-pro-crack/
javed672 · 7 weeks and 4 days ago
GotoAssignmentHelp is Assignment Help Company providing writing services in world. We always look customer satisfaction rather than demanding only money. https://www.gotoassignmenthelp.com/us/assignment-help/cheap-assignment-writing-service/ https://www.gotoassignmenthelp.com/us/assignment-help/university/
annybank2018 · 7 weeks and 3 days ago
Thanks for sharing, I found a lot of interesting information here. A really good post, very thankful and helpful. MyLowesLife
timothy_87 · 7 weeks ago
While research has shown comparable withdrawal reactions is marijuana users as in alcohol or other drugs (Ashton, 2001), what I have witnessed many times in my personal interaction with clients is the apparent lack of withdrawal experienced by most marijuana users. Of course they experience cravings, but they don't report having the same neurophysical withdrawal reaction that the other drug users have. Some marijuana smokers use this as their final proof that marijuana "is not a drug" and they should therefore not be subjugated to the same treatment and pursuit of recovery efforts as other drug or alcohol abusers. worldxpressmarijuana.com
robinjack · 6 weeks and 4 days ago
The command can I execute to check the directories inside a folder and if the total size of the directory is smaller than 30MB, delete it? I played around with the find command trying to move files based in the size but it didn't work properly. DGCustomerFirst
Kemmer · 5 weeks and 3 days ago
Awesome Code Mortgage Lender in Austin
Modernhomes07 · 5 weeks ago
Thank you for sharing; I discovered a lot of useful stuff here. A fantastic article that is both appreciative and useful. among us
kanejoyce · 4 weeks and 4 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: