Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  1. #!/bin/sh
  2. clear
  3. # change local directory
  4. cd [local-directory]
  5.  
  6. #collect file names
  7. ftp -ni ftp.abccompany.com <<EOF
  8. user [user] [password]
  9. cd /OUT
  10. mls abc*.* list.txt
  11. quit
  12. EOF
  13.  
  14. # create ftp action list
  15. echo >>todo.lst user [user] [password]
  16. while read N
  17. do
  18. echo >>todo.lst cd /OUT
  19. echo >>todo.lst get $N
  20. echo >>todo.lst rename $N ARCHIVE/$N
  21. done <list.txt
  22.  
  23. echo >>todo.lst quit
  24.  
  25. # ftp transfer process
  26. ftp -nv ftp.abccompany.com <todo.lst
  27.  
  28. # cleanup
  29. rm todo.lst
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement