• Rob's side project: I recently started Gun-Forums.com and we currently have a $100 raffle - if you're into guns, join up and enter the raffle to win $100.00. Gun Forums

Delete a archived folder

sky07

New Member
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,
 


Tolkem

Active Member
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

No members online now.

Top