- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Creating a Recycle Bin for Unix
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2004 11:41 AM
03-13-2004 11:41 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2004 12:28 PM
03-13-2004 12:28 PM
Re: Creating a Recycle Bin for Unix
However, the solution is backups. If you keep regular backups, then missing files and directories can be restored. I would always alias the rm, mv and cp commands to include the -i option to prevent mistakes:
alias rm='/usr/bin/rm -i'
alias mv='/usr/bin/mv -i'
alias cp='/usr/bin/cp -i'
NOTE: Users (and root) can override the -i option with -f.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2004 03:23 PM
03-13-2004 03:23 PM
Re: Creating a Recycle Bin for Unix
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2004 04:42 PM
03-13-2004 04:42 PM
Re: Creating a Recycle Bin for Unix
Bill's proposal will create a recyling bin which you will need to reveiw.
rmcheck
echo "are you sure you want to delete?Y/N"
read a
if [ "$a" = "Y" ]
then
rm $1
fi
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-13-2004 05:40 PM
03-13-2004 05:40 PM
Re: Creating a Recycle Bin for Unix
Apart from the wrapper script idea above,which only applies to the "rm" command, you can't do this. Any application that calls the standard C library "unlink" call (the one that does deleting) will delete your file. Unless you change this, which you can't on hpux, the recycle bin idea doesn't work.
Sorry.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2004 11:44 PM
03-14-2004 11:44 PM
Re: Creating a Recycle Bin for Unix
to enforce this upon every user you could make an alias of rm that calls 'rm -i'.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2004 12:06 AM
03-15-2004 12:06 AM
SolutionWhile clearly not as clean as the overall solution you are looking for on unix, I often keep around directories which I name such wonderful names as: keep_until_september_01_2004.
I can then search for all of my "keep_until" directories with a script and get rid of the old ones.
I put things like scripts that I'm writing to post out to the ITRC in directories such as these.
I also do the same thing with Mail folders. I always have one that is dated six months from now for all of those kinds of emails that you might need in the next couple of weeks but will never need after that.
Every time a new month rolls around, I delete the (for instance keep-030104), move the a-090104 to keep-090104 and create an a-100104 folder (the a- I use to put it at the top of my mail folders).
Helps keep the junk down.
Best regards,
Kent M. Ostby
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2004 12:23 AM
03-15-2004 12:23 AM
Re: Creating a Recycle Bin for Unix
IF, your "Unix users" are working in a purely GUI environment (ie. KDE, Gnome,etc.).. AND they are using the GUI's file manager , etc. then each environment already has a "Recyle Bin" like scheme..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2004 04:26 AM
03-15-2004 04:26 AM
Re: Creating a Recycle Bin for Unix
Thanks