M
M
Maxim Shishkov2019-03-01 17:31:12
Debian
Maxim Shishkov, 2019-03-01 17:31:12

How to delete files from trash older than 7 days?

Good day. I have Zentyal Server Development Edition 6.0 installed. It has a recycle bin functionality where files are moved when they are deleted. It seems that I figured out how to delete old files, but how to delete them from folders using the following path pattern:

find /var/lib/samba/_произвольное_имя_папки_/recyclebin/* -mtime +7 -delete

And further. How to delete empty directories in the same recycle bin after a previous cleanup?
Thanks

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
nihi1ist, 2019-03-20
@nihi1ist

Use the -typetype key you are looking for: f=file, d=directory, l=link, p=pipe, s=socket. For example:

# Удалить файлы
find /var/lib/samba/_произвольное_имя_папки_/recyclebin/ -type f -mtime +7 -delete
# Удалить каталоги
find /var/lib/samba/_произвольное_имя_папки_/recyclebin/ -type d -mtime +7 -delete

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question