SSHFS wrapper scripts:
cs-sshfsconnect:
cs-sshfsconnect [ remotehost[:[remotedir]] | remotedir ] [ localdir | label ]
Connects the remotedir of the remotehost on the localdir.
- remote:
if you don't specify either remotehost or remotedir, your departmental home directory is mounted via ssh.cs.kuleuven.be
if you don't specify a remotedir, your (remote) home directory is mounted via the specified remote host
if you do not specify a remotehost, the specified remotedir is mounted via ssh.cs.kuleuven.be.
the distinction between the last 2 is made with:
if the first argument contains a : it is assumed to be remotehost:[remotedir] (remotedir is still optional with as default/fallback your remote home directory).
if the first argument doesn't contain : but contains a /, it is assumed to be remotedir and mounted via ssh.cs.kuleuven.be.
if the first argument doesn't contain : and no /, it is assumed to be remotehost and your remote home directory is mounted using the specified host.
-
local (on your laptop):
if the specified localdir contains a /, it is assumed to be the full path to mount the remotedir on.
if the specified localdir does not contain /, it is assumed to be the name of the sub-dir in/of ~/NoCsRsync/SSHFS on which to mount the remotedir.
if localdir does not already exist, it will be created automatically.
if localdir already exists, it will check if it is empty. if not, it will stop without mounting and give a warning.
if you don't specify a localdir it will use ~/NoCsRsync/SSHFS/X (unless that directory already exists and is not empty) with:
X = basename of remotedir if specified
X = remotehost if no remotedir was specified
X = your login name if neither remotehost nor remotedir is specified
- examples:
to mount your departmental home directory:
cs-sshfsconnect
to mount your personal web directory:
cs-sshfsconnect /cw/w3people/firstname.lastname
to mount a different departmental directory:
cs-sshfsconnect /path/to/different/directory
to have full control of what you mount where via which machine:
cs-sshfsconnect machine.cs.kuleuven.be:/path/to/remote/directory /path/to/local/directory
| -l|--list : | list all mounted sshfs file systems |
| -c|--clean|--cleanup : | remove local mount-points that are currently not in use (left-overs from previous use) |
| -o sshfsoption=value : | use the specified sshfs options for the connection (e.g. different ssh-port) |
| -h|--help : | show this help |
cs-sshfsdisconnect:
cs-sshfsdisconnect [ sshfs-directory-to-unmount ]
if you don't specify a directory-to-unmount, it looks for exactly 1 sshfs mounted directory and if so, proposes to unmount it
- example:
cs-sshfsdisconnect
No sshfs file system specified on command line, but exactly one mounted:
/home/username/NoCsRsync/SSHFS/public_html
Press Enter to unmount it or Ctrl-C to abort.
however make sure that the umounting is possible, if the directory is still in use the umount will not work. you will be notified of this on stdout, so pay attention to that!
fusermount: failed to unmount /home/username/NoCsRsync/SSHFS/public_html: Device or resource busy
| -a|--all : | unmount all mounted sshfs file systems |
| -l|--list : | list all mounted sshfs file systems |
| -n|--dryrun : | show but do not actually unmount (has no effect with list) |
| -v|--verbose : | show what is happening |
| -h|--help : | show this help |
Short aliases:
If you don't like these long commands you can shorten them with aliases by adding the following in your .bashrc:
alias sfc='cs-sshfsconnect '
alias sfd='cs-sshfsdisconnect '

