SHARE
TWEET

Untitled

a guest Oct 4th, 2017 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. HOST='ftp1.halmed.hr'
  4. USER='testweb'
  5. PASS='Halmed123'
  6.  
  7. #provjeri broj parametara
  8. if [ $# -eq 0 ]
  9.   then
  10.     echo $0 [lokalni_direktorij] ime_datoteke
  11. fi
  12.  
  13. #opcionalno setiraj lokalni direktorij
  14. if [ $# -eq 2 ]
  15.   then
  16.     LDIR=$1
  17.     FNAME = $2
  18.   else
  19.     LDIR='/opt/backup_arhiva/'
  20.     FNAME=$1
  21. fi
  22.  
  23. echo DEBUG: $LDIR $FNAME
  24.  
  25. #provjeri da stvari postoje: direktorij i file
  26. if [ ! -d $LDIR ]
  27.   then 
  28.     echo Lokalni direktorij $LDIR ne postoji
  29.     exit 1
  30. fi
  31.  
  32. if [ ! -f $FNAME ]
  33.   then 
  34.     echo Lokalna datotkea $LDIR $FNAME ne postoji
  35.     exit 1
  36. fi
  37.    
  38.  
  39.  
  40. exit
  41.  
  42.  
  43. ftp -pin $HOST <<EOF
  44. user $USER $PASS
  45. binary
  46. lcd $LDIR
  47. put $2
  48. bye
  49. EOF
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top