Rule to securely delete file on external HD
![Post Post](./styles/noodlesoft/imageset/icon_post_target.gif)
Hi there,
I'd like to set up a rule in Hazel that will securely delete a dmg on an external harddrive.
I use DropDMG to create a compressed, encrypred dmg that is being backed up to an online backup-server once or twice a week.
Both the creation of the dmg and the backing-up to the online backup-server are automated.
However, DropDMG does not overwrite an exisiting dmg with the same name that is still in place on the ext. HD but rather gives it a _1.dmg name.
So in order to keep the whole procedure automatic, I would like to erase the dmg after it has been sent to the server so DropDMG will create a dmg with the same name the next time - thus allowing for an automatic transfer of the file to the online backup-server (as setup in a script).
Since the dmg is only used for this sole purpose, I would like to securely delete it using the equivalent of the Finders "securely delete trash". I also backup a complete bootable clone of the int. HD to my ext. HD - the online backup is meant for total desaster like theft or the like.
The Hazel rule I set up is as follows:
If all of the following conditions are met
Full Name - is - file.dmg
Date Created - is not in the last - 2 - Days
Do the following
Run shell script - embedded script
Shell: ???
Send Growl notification - with pattern - ...
I would like to securely delete the dmg not taking a detour over the regular trashcan but rather securely delete it right away.
Any idea of how the shell script should look like. Keep in mind, the file to be deleted is on an external drive. I'm very much of a scripting amateur, so explanation catered to the dummy would be very much appreciated (like what has to be in the upper part of the Edit Script window of Hazel, and what should be stated in the lower window).
Since the creation of the dmg by DropDMG as well as the transfer of the dmg are part of an overnight process, I assume Hazel would delete the file exactly 48 hrs later, right? (as the rule says "Date Created - is not in the last - 2 - Days").
Thanks
Jo*
I'd like to set up a rule in Hazel that will securely delete a dmg on an external harddrive.
I use DropDMG to create a compressed, encrypred dmg that is being backed up to an online backup-server once or twice a week.
Both the creation of the dmg and the backing-up to the online backup-server are automated.
However, DropDMG does not overwrite an exisiting dmg with the same name that is still in place on the ext. HD but rather gives it a _1.dmg name.
So in order to keep the whole procedure automatic, I would like to erase the dmg after it has been sent to the server so DropDMG will create a dmg with the same name the next time - thus allowing for an automatic transfer of the file to the online backup-server (as setup in a script).
Since the dmg is only used for this sole purpose, I would like to securely delete it using the equivalent of the Finders "securely delete trash". I also backup a complete bootable clone of the int. HD to my ext. HD - the online backup is meant for total desaster like theft or the like.
The Hazel rule I set up is as follows:
If all of the following conditions are met
Full Name - is - file.dmg
Date Created - is not in the last - 2 - Days
Do the following
Run shell script - embedded script
Shell: ???
Send Growl notification - with pattern - ...
I would like to securely delete the dmg not taking a detour over the regular trashcan but rather securely delete it right away.
Any idea of how the shell script should look like. Keep in mind, the file to be deleted is on an external drive. I'm very much of a scripting amateur, so explanation catered to the dummy would be very much appreciated (like what has to be in the upper part of the Edit Script window of Hazel, and what should be stated in the lower window).
Since the creation of the dmg by DropDMG as well as the transfer of the dmg are part of an overnight process, I assume Hazel would delete the file exactly 48 hrs later, right? (as the rule says "Date Created - is not in the last - 2 - Days").
Thanks
Jo*