Guest User

Untitled

a guest
May 9th, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. #!/bin/bash
  2. date= -`date +%d%m%y`
  3. cd /home/ratten/zaloha/
  4. tar -cf archiv.tar$date /mdl/srvr/* /home/ratten/zaloha/db*
  5.  
  6.  
  7.  
  8. HOST=ftp.server.com #This is the FTP servers host or IP address.
  9. USER=ftpuser #This is the FTP user that has access to the server.
  10. PASS=password #This is the password for the FTP user.
  11.  
  12. # Call 1. Uses the ftp command with the -inv switches. -i turns off interactive prompting. -n Restrains FTP from attempting the auto-login feature. -v enables verbose and progress.
  13.  
  14. ftp -inv $HOST << EOF
  15.  
  16. # Call 2. Here the login credentials are supplied by calling the variables.
  17.  
  18. user $USER $PASS
  19.  
  20. # Call 3. Here you will change to the directory where you want to put or get
  21. cd /home/ratten/zaloha/
  22.  
  23. # Call4. Here you will tell FTP to put or get the file.
  24. put archiv.tar$date
  25.  
  26. # or
  27. get test.txt
  28. bye
  29. EOF
Add Comment
Please, Sign In to add comment