Data hosted with ♥ by Pastebin.com - Download Raw - See Original
  1. #!/bin/bash
  2.  
  3. nameOfDirectory1=/media/external/testServer/
  4. nameOfDirectory2=test/
  5. testForExternal=/media/external/
  6. readFromFile=test/testServer/testServer.txt
  7.  
  8. if find "$testForExternal" -maxdepth 0 -empty | read; then
  9. echo "There is no existing external harddrive"
  10. exit
  11. else
  12.  
  13. for i in "$nameOfDirectory1"
  14. do
  15. echo "copying files from $i to $nameOfDirectory2"
  16. echo " "
  17. cp -r $i $nameOfDirectory2
  18. done
  19. fi
  20.  
  21. cat $readFromFile