刘凡 9ff4d1d109 add S3,archive,truncate | 2 лет назад | |
---|---|---|
.. | ||
.gitignore | 2 лет назад | |
LICENSE | 2 лет назад | |
README.md | 2 лет назад | |
shredir.py | 2 лет назад |
Truncate name and remove directory like "shred -u"
usage: shredir.py [-h] [-c COUNT] [-u] [-v] [-z] directory
positional arguments:
directory Directory
optional arguments:
-h, --help show this help message and exit
-n COUNT, --iterations COUNT
Overwrite count (Default: 3)
-u, --remove Truncate and remove directory after overwriting (Default: True)
-v, --verbose Verbose output
-z, --zero Add a final overwrite directory name with zeros (Default: True)
Remove directory
shredir.py /path/to/directory
Recurcive remove directories in current directory
# Before you need remove all files in directory
find . -type f -print0 | xargs -0 shred -uz
# Recursively remove directory
for DIRECTORY in `find . -type d | egrep -v '^\.$'`
do
shredir $DIRECTORY
done