Option to move and permanently delete

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.:
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.
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.