Skip to content
Snippets Groups Projects
transfer.screen 1.8 KiB
Newer Older
  • Learn to ignore specific revisions
  • # file transfer from local machine to the remote cluster
    # toto i v CZ
    
    # create local directory with files
    $ mkdir folder
    $ cd folder
    
    # using scp command to transfer a file
    $ touch test_file.scp
    $ scp test_file.scp dd-16-12-13@salomon.it4i.cz:/home/training/dd-16-12-13/test_file.scp
    
    # using scp command to transfer a directory
    $ mkdir local_dir
    $ touch local_dir/file
    $ scp -r local_dir dd-16-12-13@salomon.it4i.cz:/home/training/dd-16-12-13/local_dir
    
    # using sftp command
    $ touch test_file.sftp
    $ sftp -o IdentityFile=/home/local/.ssh/id_rsa dd-16-12-13@salomon.it4i.cz
    # ukazat i interaktivni rezim
    # commands: https://www.digitalocean.com/community/tutorials/how-to-use-sftp-to-securely-transfer-files-with-a-remote-server  
    # list of all commands - help or ?
    sftp> help
    
    # display remote working directory on Salomon
    sftp> pwd
    # display remote directory listing on Salomon
    sftp> ls -la
    # display statistics for remote directory
    sftp> df -h
    
    # display local working directory on linux machine
    sftp> lpwd
    # display local directory listing on linux machine
    sftp> lls -la
    
    # now we can upload a file from linux machine to Salomon
    sftp> put test_file.sftp
    
    # and then check if successfull uploaded
    sftp> ls -l
    
    # of course we can download a file from remote machine
    sftp> get tutorial.tgz
    
    # and check in local directory
    sftp> lls -l
    
    # delete local file from sftp
    sftp>!rm tutorial.tgz
    
    # quit sftp
    sftp> exit
    
    
    #####################
    # using sshfs command
    # zatim nedelat
    $ touch test_file.sshfs
    ## zjistit mountpoint!
    $ sshfs -o IdentityFile=/home/local/.ssh/id_rsa dd-16-12-13@salomon.it4i.cz:. /home/training/dd-16-12-13
    #####################
    
    # login to the Salomon cluster and check all transfered files
    ssh -i /home/local/.ssh/id_rsa dd-16-12-13@salomon.it4i.cz
    
    $ls -l
    
    # yes, all files are stored to home directory on the cluster