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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script helping

Status
Not open for further replies.

fedtegreve

Technical User
Apr 15, 2003
6
DK
Hi.

I'm new to the forum and also to unix. Have have a problem, that I hope some of you can help me with.

I have a lot of SCO UNIX PC's that I can reach by telnet. That have some backupfiles in a directory, that I need to know about; filename and the date thay are made.

I know of a command; frcp, that copy a file from my local PC to the remote host.

What I'm asking for is a script that can make this:
A textfile of the direktory with the backup-files:
ls -l /backup > /mydir/'hostname'.bac

Now copy to my own local PC:
frcp host:/mydir/'hostname'.bac /localdir/

Can this be done in one script easily? I would be thanksfull.

Benny
Denmark
 
Hello Beeny!

I guess you mean 'rcp' not 'frcp'. Make sure you read 'man rcp' for proper syntax/usage and other prerequisites.

As per the script, any executable command can run within a shell script. I normally do this using ftp. Following should give you an idea

# List /backup file to text file
ls -l /backup > /tmp/backuplist.txt
cd /tmp

ftp [remotehost] << EOF
cd /localdir
ascii
put backuplist.txt
q
EOF


You can even put multiple files using mput and wildcards.

Hope this points you in the right direction!


Jose Lerebours







KNOWLEDGE: Something you can give away endlessly and gain more of it in the process! - Jose Lerebours
 
Hi.
Thank you for the tips, I surely can use it, thou I have another problem with accessing. But I think it s because the remote computer don't have a .rhosts file, where my computer-IP isn't listed. But I will try so soulve it my self.

Again thanks

Benny, Denmark
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top