Back to home page

MITgcm

 
 

    


Warning, /tools/upload_sftp is written in an unsupported language. File is not indexed.

view on githubraw file Latest commit cd672fab on 2026-07-28 23:50:17 UTC
cd672fab6e Jean*0001 #! /usr/bin/env bash
                0002 
                0003 destDir='/uploads/'
                0004 if [ $# -lt 2 ] ; then
                0005   echo
                0006   echo "Usage:  $0  this-file  this-remote-machine [destination-dir]"
                0007   echo
                0008 #- description
                0009   echo " Send file 'this-file' to 'this-remote-machine' (User@Host type)"
                0010   echo "            in dir (on remote) 'destination-dir' (DEF='$destDir')"
                0011   echo "      using system 'sftp' command."
                0012   echo
                0013   exit 9
                0014 fi
                0015 file=$1
                0016 remote=$2
                0017 if [ $# -eq 3 ] ; then destDir=$3 ; fi
                0018 
                0019 sftp $remote <<EOF
                0020     put -p $file $destDir
                0021     bye
                0022 EOF
                0023 retVal=$?
                0024 exit $retVal
                0025