Option to move and permanently delete

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

Moderators: Mr_Noodle, Moderators

Option to move and permanently delete Fri Jan 06, 2017 4:54 am • by shazoom
I'm using Hazel to move compressed backups of VMs to a large memory card (256GB,) off my MBP's SSD. I'm only backing-up 2 VMs at the moment but they consume about 65GB compressed.

The move action is set to replace existing files—this behaviour puts pre-existing files in the trash. I tried cleaning them up with the Trash rules by deleting overlarge files and setting the limit to 5GB. However, it takes a few minutes to run the Trash rules. So, I need to leave double the disk space, these files consume, available to accommodate these few minutes.

I really don't like this, so I wrote a Korn shell script (yes, it's my personal favourite; but I think this will probably work in Bash) to delete the file.:
Code: Select all
filename="${1##*/}"
dst="/Volumes/Transcend/vm_hotbackup/${filename}"
if [[ -f "${dst}" ]]; then
   rm "${dst}"
fi


which is ok, it works, but there is a lot of information being duplicated and written by hand. Easy to get this wrong typing it out or to forget to quote something. The point I'm making is that I think there should be an option to delete the pre-existing file without moving it to trash.
shazoom
 
Posts: 2
Joined: Thu Jan 05, 2017 9:08 pm

Re: Option to move and permanently delete Fri Jan 06, 2017 12:12 pm • by Mr_Noodle
Hazel only deletes things outright from the trash. By design, it does not delete things from anywhere else, instead opting to put things in the trash.

Do you have Hazel set to do secure deletes? If so, are you using solely SSDs/flash memory? If the answer is yes to both, then you should turn of secure delete. Secure deletion is only effective on non-flash based storage. By turning it off, it should make deletion much quicker (near instantaneous).
Mr_Noodle
Site Admin
 
Posts: 11235
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Option to move and permanently delete Sat Jan 07, 2017 11:44 pm • by shazoom
Mr_Noodle wrote:Do you have Hazel set to do secure deletes?

No, I didn't turn it on

Mr_Noodle wrote:If so, are you using solely SSDs/flash memory? If the answer is yes to both, then you should turn of secure delete. Secure deletion is only effective on non-flash based storage. By turning it off, it should make deletion much quicker (near instantaneous).

Hmmmm, it really isn't near instantaneous in my experience, it seems to take a couple of minutes to trigger. If it was a couple of seconds I think it word trigger and free the space before the volume was full, breaking the move op.

If you want to contact me about the Trash rule taking a long time to trigger, I'd be happy to help figure out why.

p.s. sorry about the double submission
shazoom
 
Posts: 2
Joined: Thu Jan 05, 2017 9:08 pm

Re: Option to move and permanently delete Tue Jan 10, 2017 11:53 am • by Mr_Noodle
Email in the logs for a specific file that took a while to be deleted and I'll take a look at it.
Mr_Noodle
Site Admin
 
Posts: 11235
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Open Discussion

cron