commit
f2bfe02cc1
7 changed files with 65 additions and 10 deletions
@ -0,0 +1,45 @@ |
|||||||
|
#!/usr/bin/sh |
||||||
|
|
||||||
|
# A script to create a zip archive of any recentally modified files |
||||||
|
|
||||||
|
|
||||||
|
# Set the defaults |
||||||
|
mtime="7" |
||||||
|
filename="" |
||||||
|
|
||||||
|
while [ $1 ]; do |
||||||
|
case $1 in |
||||||
|
-h|--help) |
||||||
|
echo "Zips recentally modified files" |
||||||
|
echo "" |
||||||
|
echo -e "Use this to create a zip archive of recentally modified files" |
||||||
|
echo -e "Usage: zip-recent [options] filename" |
||||||
|
echo "" |
||||||
|
echo -e "Options" |
||||||
|
echo -e "\t-mtime\t\tThe number of days that should be considered recent [default=$mtime]" |
||||||
|
exit 0 |
||||||
|
;; |
||||||
|
-mtime) |
||||||
|
shift |
||||||
|
mtime="$1" |
||||||
|
shift |
||||||
|
;; |
||||||
|
*) |
||||||
|
filename="$1" |
||||||
|
shift |
||||||
|
;; |
||||||
|
esac |
||||||
|
done |
||||||
|
|
||||||
|
if [ "$filename" = "" ]; then |
||||||
|
echo "You need to enter a filename" |
||||||
|
exit 1 |
||||||
|
fi |
||||||
|
|
||||||
|
# Make sure the filename ends with .zip |
||||||
|
filename="${filename%\.zip}.zip" |
||||||
|
|
||||||
|
|
||||||
|
find . -type f -mtime -$mtime -exec zip $filename {} \; |
||||||
|
|
||||||
|
|
@ -1 +1 @@ |
|||||||
Subproject commit 3158f31419852bf8c413eef06ba7ebc83e5982f9 |
Subproject commit 702903b58931978c03e3a6f078058fa1284ae8fe |
@ -0,0 +1,2 @@ |
|||||||
|
#"pkill -u $USER -SIGWINCH zsh" |
||||||
|
# Caps_Lock |
Loading…
Reference in new issue