44# example: usb:///dev/sdb1
55# example: tape:///dev/nst0
66# example: file:///path
7+ # example: sshfs://user@host/G/rear/
78
89[[ " $BACKUP_URL " || " $BACKUP_MOUNTCMD " ]]
910StopIfError " You must specify either BACKUP_URL or BACKUP_MOUNTCMD and BACKUP_UMOUNTCMD !"
@@ -13,22 +14,30 @@ if [[ "$BACKUP_URL" ]] ; then
1314 local scheme=$( url_scheme $BACKUP_URL )
1415 local path=$( url_path $BACKUP_URL )
1516
16- # ## check if host is reachable
17- if [[ " $PING " && " $host " ]]; then
18- ping -c 2 " $host " >&8
19- StopIfError " Backup host [$host ] not reachable."
20- else
21- Log " Skipping ping test"
22- fi
23-
2417 # ## set other variables from BACKUP_URL
2518 case $scheme in
2619 (usb)
2720 if [[ -z " $USB_DEVICE " ]] ; then
2821 USB_DEVICE=" $path "
2922 fi
3023 ;;
24+ (sshfs)
25+ # check if $host contains a '@' because then we use user@host format
26+ echo $host | grep -q ' @' && {
27+ sshfs_user=" ${host%%@* } " # save the user
28+ host=" ${host#*@ } " # remove user@
29+ }
30+ ;;
3131 esac
32+
33+ # ## check if host is reachable
34+ if [[ " $PING " && " $host " ]]; then
35+ ping -c 2 " $host " >&8
36+ StopIfError " Backup host [$host ] not reachable."
37+ else
38+ Log " Skipping ping test"
39+ fi
40+
3241fi
3342
3443# some backup progs require a different backuparchive name
6473xz
6574)
6675
76+ [[ " $scheme " = " sshfs" ]] && { # see http://sourceforge.net/apps/mediawiki/fuse/index.php?title=SshfsFaq
77+ REQUIRED_PROGS=( " ${REQUIRED_PROGS[@]} " sshfs )
78+ PROGS=( " ${PROGS[@]} " fusermount mount.fuse )
79+ MODULES=( " ${MODULES[@]} " fuse )
80+ MODULES_LOAD=( " ${MODULES_LOAD[@]} " fuse )
81+ # as we're using SSH behind the scenes we need our keys/config file saved
82+ COPY_AS_IS=( " ${COPY_AS_IS[@]} " $HOME /.ssh /etc/fuse.conf )
83+ }
84+
85+
6786# include required modules, like nfs cifs ...
6887MODULES=( " ${MODULES[@]} " $( url_scheme $BACKUP_URL ) )
0 commit comments