hello mirni , I can not use this script because file1.txt and file2.txt are in different folders. What I am trying to do exactly is , there are logs generated for different applications , so I am trying to copy all the logs into one location .
actually my script is #!/bin/sh
file1=user1@domain2.com:/path1/file1.txt (completePath to file1.txt)
file2=user1@domain2.com:/path2/file2.txt (completePath to file2.txt)
files=( ${file1} ${file2} )
scp ${files[@]} /home/path3 to save files
echo done copying
---------- Post updated at 04:32 PM ---------- Previous update was at 04:21 PM ----------
currently i am saving the files in my local and then copying into the remote location using batch script. like
C:\pscp.exe
user1@domain1.com:/path1/file1.txt C:\path\Work\domain1
C:\pscp.exe
user1@domain2.com:/path2/file2.txt C:\path\Work\domain2
C:\pscp.exe
user1@domain3.com:/path3/file3.txt C:\path\Work\domain3
C:\pscp.exe C:\path\Work\domain1\file1.txt
user1@domain4.com:/path1
C:\pscp.exe C:\path\Work\domain2\file2.txt
user1@domain4.com:/path2
C:\pscp.exe C:\path\Work\domain3\file3.txt
user1@domain4.com:/path3
I need not type any password here it is preauthenticating using my company' s laptop . Was just wondering , if i can skip the step of saving these files to local and do the transfers directly without having to type password many times.