projects
/
wizbackup.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
94ba89b
)
Exclude tmp dir from pruning
author
Bernie Innocenti
<bernie@codewiz.org>
Mon, 25 Jul 2011 20:07:01 +0000
(16:07 -0400)
committer
FSF BOFH
<sysadmin-nonrt@fsf.org>
Mon, 25 Jul 2011 20:07:01 +0000
(16:07 -0400)
wizbackup
patch
|
blob
|
history
diff --git
a/wizbackup
b/wizbackup
index f47d7f8c98efcdbd5c7a8607add6b7af3cea2880..034651a997fd3747d17f4c4c257ed3bda82796df 100755
(executable)
--- a/
wizbackup
+++ b/
wizbackup
@@
-12,8
+12,7
@@
# or (at your option) any later version.
# or (at your option) any later version.
-if [ $# -lt 2 ]
-then
+if [ $# -lt 2 ]; then
echo "Usage: $0 SOURCE DEST [RSYNC_OPTS]"
exit 1
fi
echo "Usage: $0 SOURCE DEST [RSYNC_OPTS]"
exit 1
fi
@@
-99,7
+98,7
@@
do_init()
do_prune()
{
do_prune()
{
- local old="`ls | head -n -$N_SNAPSHOT`"
+ local old="`ls |
grep -v tmp |
head -n -$N_SNAPSHOT`"
if [ ! -z "$old" ]; then
echo "$(date): Removing oldest snapshot(s): $old..."
rm -rf "$old" || exit 669
if [ ! -z "$old" ]; then
echo "$(date): Removing oldest snapshot(s): $old..."
rm -rf "$old" || exit 669
@@
-108,7
+107,7
@@
do_prune()
do_link()
{
do_link()
{
- local newest=`ls | tail -n 1`
+ local newest=`ls |
grep -v tmp |
tail -n 1`
if [ -z "$newest" ]; then
echo "$(date): No previous snapshot found, performing a full backup!"
elif [ -d "$DEST/tmp" ]; then
if [ -z "$newest" ]; then
echo "$(date): No previous snapshot found, performing a full backup!"
elif [ -d "$DEST/tmp" ]; then