From 1c6735d16bef0aa304530001280935a5e65d405f Mon Sep 17 00:00:00 2001 From: "Adrian C. (anrxc)" Date: Thu, 3 Jun 2010 22:44:54 +0200 Subject: rybackup: allow fstab mounts and sshfs Omitting all remote settings the mount command in the end calls only: "mount /mnt/destination". Also, by using "fuse" as remote fs-type and "sshfs#user@server:" as dev we should be able to perform sshfs mounts (port if needed can be specified in the options like: "port=portnum"). --- rybackup.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/rybackup.py b/rybackup.py index f78d18f..4e734be 100755 --- a/rybackup.py +++ b/rybackup.py @@ -39,7 +39,7 @@ bak = { # Remote backup server, or removable storage rmt = { - "fst" : "nfs", # file-system type + "fst" : "-t nfs", # file-system type "opt" : "-o async,vers=3", # mount options, if any "dev" : "192.168.0.10", # device node or NFS host "dst" : "/mnt/backup/clientname" # remote NFS export @@ -134,13 +134,12 @@ def mount(action): if action == "mount": # Include the export for NFS - if rmt['fst'] == "nfs": + if rmt['fst'] == "-t nfs": rmt['dev'] = "%s:%s" % (rmt['dev'], rmt['dst']) # Attempt to mount the destination - if call("%s -t %s %s %s %s" - % (bin[action], rmt['fst'], rmt['opt'], - rmt['dev'], bak['dst']), shell=True) != 0: + if call("%s %s %s %s %s" % (bin[action], rmt['fst'], rmt['opt'], + rmt['dev'], bak['dst']), shell=True) != 0: raise SystemExit("Error: could not mount destination") elif action == "umount": # Unmount the snapshot mountpoint -- cgit v1.2.3