7 ms·
Show HN: Set OS X files and folders to self-destruct based on tag
- kolev 12y agoThis is a pretty good idea. Add the ability to tag a file/files with TTL from the CLI as well. Source code: https://github.com/tdlm/os-x-self-destruct https://github.com/tdlm/os-x-self-destruct
- scott_karana 12y ago> Add the ability to tag a file/files with TTL from the CLI as well. You can use the OS's standard facilities to do what you want: see `xattr` and `mdfind`.[1] There's also `tag`[2] 1 http://apple.stackexchange.com/questions/93979/are-the-osx-mavericks-tags-visible-from-the-command-line 2 https://github.com/jdberry/tag
- kolev 12y agoI'm using tag, too, but it's in C, so, I suggested xattr to the author. I submitted an issue already (first!): https://github.com/tdlm/os-x-self-destruct/issues/1 https://github.com/tdlm/os-x-self-destruct/issues/1
- jason_slack 12y agoInteresting idea, can anyone give me ideas for specific use cases in everyday use?
- johndavi 12y agoI use Hazel (mentioned by drhayes9 too) to monitor various folders and take action regularly. On the delete side, this includes: * clearing out any items in Downloads > 1week * clearing out any items from my "Temp" folder > 1 day, unless they have an explicit "save" tag ("Temp" is my go-to alternative to the Desktop and is where I stash anything, well, temporary-ish) * automatically moving screenshots into my Temp folder (where they will soon be deleted)
- ullrich 12y agoYou know you can specify the folder screenshots are saved to by using: defaults write com.apple.screencapture location /Full/Path/To/Folder
- arsenerei 12y agoAn open-source, CLI-alternative is maid. It really allows me to scratch my programmer's itch. https://github.com/benjaminoakes/maid https://github.com/benjaminoakes/maid
- hk__2 12y agoWhy not using /tmp?
- scott_karana 12y ago1 Workflow: you can put the files anywhere this way, and still have them get deleted. 2 Time granularity (though you could, I suppose, set up subdirectories in /tmp/ with associated hourly/daily/weekly/monthly cronjobs)
- drhayes9 12y agoFor easy-to-use OSX automation I'm a big fan of Hazel: http://www.noodlesoft.com/hazel.php http://www.noodlesoft.com/hazel.php I bet you could set up something similar in it.
- bithush 12y agoIt mentions it uses srm, is that any use with an SSD with wear levelling etc?
- scott_karana 12y agoProbably not. Hopefully you're also using FileVault, though it doesn't totally alleviate recovery risks (from undelete scripts, etc)
- derefr 12y agoIf this was based on atime instead of mtime, and was coupled with Time Machine backups, it'd actually make an interesting form of Hierarchical Storage Management. Files would "expire" from your local disk, but still be restorable. On a tangent, that's really what I (and I think most people) want from HSM—not "files canonically being on slow media but being cached on faster media", but rather "files canonically being on small/fast media, and then migrating to slower media when you stop caring about them, as if a garbage-collection pass had occurred, leaving your disk with more space." Basically, HSM should do automatically what people do manually when they e.g. burn files to optical disks to clear up space.
- alexisnorman 12y agoThis is awesome. I've been waiting for Yosemite's JS Automation so I can do some similar things with my downloads (Moving into folders based on tags, etc.) so this is going to be fun to play around with.
- Lai0chee 12y agoIs there no at(1) on OSX?
- alayne 12y agoYes, you could queue an at job for every deletion. If you moved the file that approach would break. Also, you'd have to remove that at queue entry if you changed your mind.