trashpark - Store files safely with querying capability
# Park one or more files or directories (recursively) trashpark file ... # Display parking history trashpark -h rw-rw-r-- 2005-08-10 23:45:38 mschilli /tmp/file r--r--r-- 2005-08-10 23:46:04 mschilli /tmp/other # Like history, just limit list to one or more # file basenames (no path will be matched) trashpark -l file ... rw-rw-r-- 2005-08-10 23:45:38 mschilli /tmp/file # Like -l, just show full path names to trashcan # instead of mode, user, move time listing trashpark -L file ... ~/.trashpark/repo/tmp/file # Expire all files in the trash can # older than 3 days trashpark -e `expr 24 * 3600 * 3`
trashpark helps removing files by hiding them in a safe location and providing a query interface.
trashpark
Without any parameters, trashpark will accept one or more names of files (or directories) to move to .trashpark:
.trashpark
$ trashpark some/file/somewhere/file.dat
Later on, files in the trashpark can be queried or expired, see details below.
Set the trash path directory explicitely. If absent, ~/.trashpark will be used.
~/.trashpark
Show the parking history of the entire trashpath repository chronologically.
Like history, just limit list to one or more file basenames (no path).
Interactive. Confirm every move with the end user.
$ trashpark -i /tmp/some.dat Move /tmp/some.dat to ~/.trashpark/repo/tmp/some.dat ([y]/n)? [y]
Expire (i.e. delete) all files in the trashpark older than age_in_seconds. To calculate larger time spans, use the expr command line utility:
age_in_seconds
expr
$ trashpark -e `expr 24 * 3600 * 3`
Destroy the entire trashpark, including the index.
Copyright 2005 by Mike Schilli, all rights reserved. This program is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
2005, Mike Schilli <cpan@perlmeister.com>
To install Trash::Park, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Trash::Park
CPAN shell
perl -MCPAN -e shell install Trash::Park
For more information on module installation, please visit the detailed CPAN module installation guide.