This is an old revision of the document!
It also possible to connect to the server via ssh protocol using command line (bash), eventually it is possible to insert the command as a parameter (it is then executed and the connection is terminated).
Available commands are provided in the /usr/bin
directory. It is also possible to use standard bash shell tools, such as pipe command. If you need to install something else please contact customer support du-support(at)cesnet.cz. The shell is generally designed only for manipulation with data but not for calculations etc.
Server supports client connection only via ssh protocol ver. 2, which is usually default option. In case that the client has default setup version at ssh protocol version 1, it is necessary manually redefine. In command line is possible to use parameter “-2”, in Putty is necessary to set “Preferred SSH protocol version” to the value “2”, eventually “2 only”.
Example of command for connect to the server:
~$ ssh username@server
Example of command for connect to the server with forcing SSH version 2 protocol:
~$ ssh -2 username@server
Commands dm* are for working with files between online (file immediately accessible) and offline (high capacity medium for data, to which is accessed time to time). Command dmls writes out the file state (location), dmput moves the file from online medium to the offline. Command dmget moves the file from offline medium to the online medium.
Command dmput
moves the file to the offline medium:
~$ dmput MB4_dul.dat
Command dmput
moves the file from the offline medium and at same time removes the file from the online medium:
~$ dmput -r MB4_ofl.dat
Command dmget
moves the file from offline medium back to the online medium:
~$ dmget MB4_dul.dat
Example of listing the directory via dmls
command:
~$ dmls -l -rw------- 1 user storage 4194304 2012-06-22 14:17 (DUL) MB4_dul.dat -rw------- 1 user storage 4194304 2012-10-26 02:03 (OFL) MB4_ofl.dat -rw------- 1 user storage 4194304 2012-10-26 02:02 (REG) MB4_reg.dat
The file status values listed via dmls
command are:
Hodnoty stavu souboru vypisované příkazem dmls
:
The example of gaining the file list in OFL state from the subdirectory tree folder
and their migration (from offline media) back to HDD::
~$ dmfind folder -state OFL -exec dmget '{}' \;
The example of gaining files in REG and DUL state from current directory and their migration to the offline medium (and they will be removed in the same time from online medium)
~$ dmfind . \( -state REG -o -state DUL \) -type f -size +100 -exec dmput -r '{}' \;
Manual pages of the commands:
Executing the command is in Putty defined in the “Connection→SSH” category, where we can insert required command into the row “Remote command”. After the command execution is the connection automatically terminated, which will cause (default settings), that the window is closed and the displayed output is lost. It is necessary to select in the Session category “Close window on exit” to “Never, to make possible to read the output.
Putty usage is beneficial especially for simple command running. Putty does not have command history and it is always necessary to insert the command again. If you log in often to the server via ssh, it is better to use in Windows system CygWin application - rsync client installation for command line in the Windows/Cygwin.
CESNET, z. s. p. o.
Generála Píky 26
16000 Prague 6
Tel: +420 234 680 222
Fax: +420 224 320 269
info@cesnet.cz
Tel: +420 234 680 222
GSM: +420 602 252 531
Fax: +420 224 313 211
support@cesnet.cz