Delete files without a trash

Talk, speculate, discuss, pontificate. As long as it pertains to Hazel.

Moderators: Mr_Noodle, Moderators

Delete files without a trash Wed Oct 28, 2020 3:21 pm • by Ni€ls
This rule deletes all files in a folder without moving them to the trash.
Files that require administrative rights are also deleted.

I use this rule to delete all log files in the folder “/ Library / Logs” that are older than 20 minutes.

Code: Select all
If all of the following conditions are met
Date created is not in the last 20 minutes
Any File


Do the following to the matched file or folder:
Code: Select all
Run shell script embedded script


Embedded script:
Code: Select all
#!/bin/bash
Sudo -S <<< “your password” rm -rf “$1”


Use at your own risk
Ni€ls
 
Posts: 20
Joined: Thu May 16, 2019 10:50 am

Return to Open Discussion

cron