Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

file extraction and scp 1

Status
Not open for further replies.

nimrodman

MIS
Nov 22, 2005
43
US
Can anyone help me at solving the following riddle, I am trying to do a simple script to:

Create a password file on server A
How can I extract certain file names from a sub directory of server A?

For example the files may be of type *.txt or *.123

Send the found files a new list and sort them by name
Change the name of the new files
Send the files to a remote server (B)
SSH to the remote server (B) to check that the files are there
If the files are there, delete them from the original host (A)
Thanks in advance for your suggestion

 
Create a password file on server A
I'm not sure what you mean by this
How can I extract certain file names from a sub directory of server A?

For example the files may be of type *.txt or *.123
man find

Send the found files a new list and sort them by name
man sort
Change the name of the new files
man mv
Send the files to a remote server (B)
man scp
SSH to the remote server (B) to check that the files are there
man ssh and ls
If the files are there, delete them from the original host (A)
look at return codes and man rm

On the internet no one knows you're a dog

Columb Healy
 
A star for columb for an excellent response. The original post sounded like it could be a school assignment to me. Your response was the perfect answer whether it was or not.
 
Thanks SamBones - that was my thinking.

On the internet no one knows you're a dog

Columb Healy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top