projects
/
scripts.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
caef540
)
Cosmetics.
author
Francois Fleuret
<francois@fleuret.org>
Sat, 17 Jun 2017 12:10:06 +0000
(14:10 +0200)
committer
Francois Fleuret
<francois@fleuret.org>
Sat, 17 Jun 2017 12:10:06 +0000
(14:10 +0200)
freeze-dir.sh
patch
|
blob
|
history
diff --git
a/freeze-dir.sh
b/freeze-dir.sh
index
81f4a6d
..
0a23b49
100755
(executable)
--- a/
freeze-dir.sh
+++ b/
freeze-dir.sh
@@
-18,9
+18,9
@@
#########################################################################
# This command makes a backup copy of a given directory into a backup
#########################################################################
# This command makes a backup copy of a given directory into a backup
-# directory, tags it with the date and time, and uses rsync
-#
intelligent features to avoid making superfluous copies of files
-#
which are already
backuped.
+# directory, tags it with the date and time, and uses rsync
smart use
+#
of hard links to avoid unnecessary duplicates of files already
+# backuped.
set -e
set -e
@@
-62,7
+62,7
@@
while [[ "$1" ]]; do
if [[ -h "${current_backup}" ]]; then
rsync --link-dest="${current_backup}/" -axz "${full_path}/" "${new_backup}/"
if [[ -h "${current_backup}" ]]; then
rsync --link-dest="${current_backup}/" -axz "${full_path}/" "${new_backup}/"
- rm
-f
"${current_backup}"
+ rm "${current_backup}"
else
if [[ -a ${current_backup} ]]; then
echo "${current_backup} exists and is not a symbolic link" >&2
else
if [[ -a ${current_backup} ]]; then
echo "${current_backup} exists and is not a symbolic link" >&2
@@
-72,7
+72,7
@@
while [[ "$1" ]]; do
fi
fi
fi
fi
- ln -s "${new_backup}" "${current_backup}"
+ ln -
v
s "${new_backup}" "${current_backup}"
sync
sync