You are not logged in.
Hi,
I'm a bit skeptical at times to use 'rm' to delete files. In fact, I really would like it if 'rm' would move files to a "recycle bin" of some sorts (Something like /trash). I like this because if I accidentally delete something, or need to go back and restore something later, I can always revisit the /trash directory.
Here is what I would like:
- A command similar to 'rm' (maybe like 'recycle') that moves files to a temporary directory, like /trash.
- The files in /trash shall be cleaned out based on age (This could be a cron job). Every day, any files older than XX days shall be deleted permanently with 'rm'.
- The 'recycle' command should have a brother 'restore' command, which when used on a file in /trash restores it to its original location.
- The /trash folder shall have a maximum size. The 'recycle' command first checks the size of /trash, if it is too full, the oldest files are removed from /trash until there is enough space for the newly recycled file/directory.
I realize a very non-trivial script could be created for these things, however I was hoping someone already went through the work. If not I may attempt to create a package for this (Something that sets up the cron jobs and everything!). Could be really useful for the paranoid deleters out there!
Last edited by void.pointer (2008-08-13 00:28:00)
Offline
Man, Google rules: http://www.linux.com/feature/138331
Offline
Man, Google rules: http://www.linux.com/feature/138331
You had a lot more luck with it than I did. Thanks for your help.
Offline
Simpler solution:
Just mv to /tmp instead of rm, as /tmp is cleaned every boot. You can even put in .bashrc:
alias trash='mv -t /tmp'
Last edited by freakcode (2008-08-13 01:25:51)
Offline