The computer operators need to do scp from several Unix (HP-UX & Linux) servers
to a dedicated PC on a frequent basis via Tcp2222.
So on those one dozen over Unix servers, I would issue :
scp -P2222 source_file_on_Unix administrator@localhost:/g/temp
Or to copy an entire directory,
scp -P2222 -r source_dir_on_Unix administrator@localhost:/g/temp
where -P2222 is to make scp to copy via Tcp2222 while /g/temp is the drive &
directory on the PC. I'll need a Korn/Bourne Shell script (as our servers
don't have bash), call it ncp to prompt operators step by step ie :
In most cases,
- the operators copy files (about 85-95% of the times) rather than entire directory
- the operators use putty (so they can easily select & paste filenames)
So ideally the requirements for the script :
Just type "ncp" (I'll put this script in the path)
& it will prompt them :
Question / prompt 1 : 1) Are you copying entire directory/folder? y/n/Y/N (default n or just ENTER
as most of the times, it's files copying) :
If y, Question /prompt 2: 2) Enter source subdirectory name :
If n (or just <ENTER>), then prompt for following questions:
Question / prompt 3 : 3) Pls input source file1 (hit ENTER if no more source file) :
Question / prompt 4 : 4) Pls input next source file (hit <ENTER>) if there's no more) :
Question / prompt N: N) ..... (to input the Nth file) .....
Last Question/prompt : Pls input the destination drive & folder (eg: /c/temp format) :
Echo "for text files, pls use WordPad or MSWord to open/read them on Windows"
lastly, if the script could input the PC's administrator's password (ie required by scp),
(let's call it pcpassword), that would be ideal, if not, then let the operators enter the
password manually.
We don't want to use private+public key pairs due as we hv to go thru cumbersome
Change Requests