local/bin/rmirror: Add -i option to ignore cvs files.
local/bin/btrfs-snap-all: Use it.master
parent
3beaadeb06
commit
c0713aeaaf
|
@ -45,7 +45,7 @@ snap () { # $1=fs $2=subvol
|
|||
local last=$(find "$fs/.snapshots/$subvol" -maxdepth 1 | tail -1)
|
||||
|
||||
$OPT_GIT_GC && git_gc "$fs/subvol"
|
||||
$OPT_PREVIEW && rmirror "$fs/$subvol" "$last"
|
||||
$OPT_PREVIEW && rmirror -i "$fs/$subvol" "$last"
|
||||
|
||||
echo -n "==> Snapshot '$fs/${subvol}'? (y/N) "
|
||||
read -r choice
|
||||
|
|
|
@ -12,6 +12,7 @@ A dry-run is made by default.
|
|||
|
||||
Options:
|
||||
|
||||
-i: Ignore CVS fils (.git and .gitignore'd files).
|
||||
-p: Process.
|
||||
-s: Ignore dates when comparing files.
|
||||
|
||||
|
@ -23,8 +24,11 @@ EOF
|
|||
## replacing -a with -lr.
|
||||
flags="-a"
|
||||
opt_dry="-n"
|
||||
while getopts ":hps" opt; do
|
||||
opt_cvs_ignore=""
|
||||
while getopts ":ihps" opt; do
|
||||
case $opt in
|
||||
i)
|
||||
opt_cvs_ignore="--cvs-exclude" ;;
|
||||
h)
|
||||
usage
|
||||
exit ;;
|
||||
|
@ -45,4 +49,4 @@ shift $(($OPTIND - 1))
|
|||
[ "$1" = "-h" ] && usage && exit
|
||||
[ "$1" = "--" ] && shift
|
||||
|
||||
rsync $opt_dry -iv $flags --size-only --delete --exclude="/lost+found" --exclude="/.Trash*" --progress -- "$1"/ "$2"
|
||||
rsync $opt_dry -iv $flags --size-only --delete --exclude="/lost+found" --exclude="/.Trash*" $opt_cvs_ignore --progress -- "$1"/ "$2"
|
||||
|
|
Loading…
Reference in New Issue