FreeBSD Bugzilla – Attachment 82516 Details for
Bug 118025
[patch] sysutils/freebsd-snapshot: automounter, mount-points
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
file.diff
file.diff (text/plain), 2.52 KB, created by
clemens fischer
on 2007-11-13 20:50:03 UTC
(
hide
)
Description:
file.diff
Filename:
MIME Type:
Creator:
clemens fischer
Created:
2007-11-13 20:50:03 UTC
Size:
2.52 KB
patch
obsolete
>--- /l/sbin/snapshot 2007-11-10 15:00:27.000000000 +0100 >+++ /root/bin/snapshot.sh 2007-11-13 21:05:45.000000000 +0100 >@@ -31,18 +31,20 @@ > # make sure system tools are used first > PATH="/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/sbin:$PATH" > > # option defaults > fs_subdir=".snap" >+mnt_dir="/mnt" > verbose=no > help=no > > # command line parsing > usage () { > echo "Usage: snapshot [<option> ...] <operation> <argument> ..." > echo "Global <option> arguments are:" > echo " -d <subdir> filesystem sub-directory of snapshots" >+ echo " -m <subdir> filesystem mount-directory for snapshots" > echo " -v enable verbose messages" > echo " -h display usage help (this message)" > echo "Operations <operations> and their arguments <argument> are:" > echo " list [<fs>]" > echo " make [-g <generations>] <fs>:<tag>[.<generation>]" >@@ -52,11 +54,11 @@ > } > if [ $# -eq 0 ]; then > usage > exit 0 > fi >-args=`getopt vhd: $*` >+args=`getopt vhd:m: $*` > if [ $? != 0 ]; then > echo "snapshot:ERROR: invalid command line arguments" 1>&2 > exit 2 > fi > set -- $args >@@ -64,10 +66,11 @@ > do > case "$arg" in > -v ) verbose=yes; shift ;; > -h ) help=yes; shift ;; > -d ) fs_subdir="$2"; shift; shift ;; >+ -m ) mnt_dir="$2"; shift; shift ;; > -- ) shift; break ;; > esac > done > if [ ".$help" = .yes ]; then > usage >@@ -143,11 +146,12 @@ > # make sure filesystem really has a snapshot subdirectory > if [ ! -d $fs_dir/$fs_subdir ]; then > continue > fi > # make sure filesystem isn't an already automounted snapshot >- if [ ".`amq $fs_dir 2>&1 | grep 'not automounted'`" = . ]; then >+ if amq -p >/dev/null 2>&1 && >+ [ ".`amq $fs_dir 2>&1 | grep 'not automounted'`" = . ]; then > continue > fi > for snap in $fs_dir/$fs_subdir/*; do > if [ -f $snap ]; then > # determine sizes >@@ -267,20 +271,20 @@ > echo "snapshot:ERROR: no such snapshot \"$fs_tag.$fs_gen\" on filesystem \"$fs_dir\"" 1>&2 > exit 1 > fi > > # mount snapshot >- op_mount $fs_dir:$fs_tag.$fs_gen /mnt >+ op_mount $fs_dir:$fs_tag.$fs_gen "$mnt_dir" > > # enter interactive shell > oldpwd=`pwd` >- system cd /mnt || exit $? >+ system cd "$mnt_dir" || exit $? > system ${SHELL-"/bin/sh"} > system cd $oldpwd > > # unmount snapshot >- op_umount /mnt >+ op_umount "$mnt_dir" > > return 0 > } > > ##
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 118025
: 82516