07-02-2008 12:11 AM - last edited on 10-06-2013 09:07 PM by maikoro
Can I have a quick discussion as to why unix creator did not include feature for recycle bin.Can we have trashcan kind of facility , like from AdvFS , in vxfs and HFS.
Your replies are highly appreciated.
P.S. This thread has been moved from HP-UX > Databases to HP-UX > sysadmin. - Hp Forum Moderator
07-02-2008 12:26 AM
CDE has a trashcan at the right side ...
You can use it when you work in the file manager of CDE.
If you use the command line (rm) then you would have to create an alias for rm.
alias rm script
Your script has to move the files to $HOME/.dt/Trash.
07-02-2008 12:29 AM
(Moderators don't like moving from one category to another in popular forums, where they expect everyone to read every thread.)
Because big boys don't admit to making mistakes? ;-)
If you want one, you can roll your own rm. Here are some old threads about your topic:
07-02-2008 04:01 AM
Why no recycle bin? Well to save precious disk space no doubt in the days when disk, memory, I/O and CPU were precious commodities not to be capraciously wasted --- something that some bloated software would do well to remember in my opinion.
In keeping with DWIM (Do What I Mean), if you ask to remove a file it is removed. No messages; no fuss; poof!
Removing a file without futher ceremony conforms to Unix's Rule of Least Surprise: Do what was asked.
07-02-2008 11:45 AM
You can easily define a wrapper to rm to provide the ability from a shell window. Just be sure to define a cron job to empty the bin.
07-06-2008 01:40 AM
Why this was not developed in UNIX , if accedental we remove a file we only lose the inode link we have , file is physically present on the disk so this is my question
why no unrm??
sorry if m getting weired but curiosity ;)
07-06-2008 01:51 AM
10 seconds later that area on the disk may be overwritten.
As Volkmar and Bob say, if you want unrm, use the trashcan in CDE.
>why no unrm??
Because a temporary limbo has to be designed into rm(1).
07-06-2008 04:20 AM
>Kapil: Like in windows if we remove data from recycle bin then also some software recover data. Why this was not developed in UNIX...why no unrm??
Again, I would respond with: Well, when do you *really* mean *remove*?
Certainly there are temporary files that processes create that would be a grand waste to confine to a recycle bin instead of casting them into oblivion.
If nothing else, you can create an alias for 'rm' that adds the '-i' switch to force you to confirm deletion in interactive settings:
# alias rm='rm -i'
Of course, this only applies to your current shell session and does not propagate to any script you run therein; nor unconditionally would you want it to do so.
If the idea of permanently removing a file bothers you, ask yourself if you *always* make a backup of every file you change?
As already noted, you can write a shell wrapper around a command and move or copy any file you want before manipulating it. In this fashion you can craft your own re-cycle bin.
A properly setup Unix server only allows the 'root' user to remove (or write to) "system" directories, like '/usr'. Non-root users can't harm your system, unless they promote themselves programatically or otherwise to a privileged level. As an administrator, you control (and hopefully prevent) this. Thus what a normal user does to hurt themselves is their own doing.
For me, it reduces to "think before you act", and have appropriate disaster recovery procedures in place for (hopefully rare) times of simple stupid, catastrophic mistakes.
07-06-2008 11:54 PM
ok - one more tipp - use a file server who uses snapshots.
This really help me with my **** users.
About once a month one user comes to me and says that he has overwritten the wrong file.
The user directories are nfs mounted from a filer.
Then I go into my filer snapshot directory and recover the file from the last day.
See for example NetApp filer.
There will be others too, that offer this option.