Delete a archived folder

sky07

New Member
Joined
Feb 4, 2020
Messages
1
Reaction score
0
Credits
0
Hi,

Am using the below format for deleting folder archived for 'x' number of days, but it doesn't work?
delete=10

find $xyz -name "*arc" -mtime +$delete -type d -exec rm -rf {} +

It doesn't error out, but doesn't delete as well

on the path, I have folder as arc-2020-01-10
My script permission is 777 ( full read/write access )

Purpose: I want to delete all the archive folders more than 10 days old.

Thanks,
 


Hi,

Am using the below format for deleting folder archived for 'x' number of days, but it doesn't work?
delete=10

find $xyz -name "*arc" -mtime +$delete -type d -exec rm -rf {} +

It doesn't error out, but doesn't delete as well

on the path, I have folder as arc-2020-01-10
My script permission is 777 ( full read/write access )

Purpose: I want to delete all the archive folders more than 10 days old.

Thanks,

Hi and welcome to the forum. You could try using ncdu https://dev.yorhel.nl/ncdu,
a disk usage analyzer with an ncurses interface. It is designed to find space hogs on a remote server where you don't have an entire graphical setup available, but it is a useful tool even on regular desktop systems. Ncdu aims to be fast, simple and easy to use, and should be able to run in any minimal POSIX-like environment with ncurses installed.
I was having a similar issue with a couple of files I could not delete and with ncdu I was able to. It is available in most distros so you shouldn't have any problems to install it and it's very small; around 100kb once installed.

Hope this helps! :)
 

Members online


Top