LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 08-31-2009, 02:48 AM   #1
prateek_sahu
LQ Newbie
 
Registered: Aug 2009
Posts: 3

Rep: Reputation: 0
Copy file from one linux server to another using shell script


Hi Every one,
I need to Copy a file located in /tmp to another linux server, this should be done using a shell script. Can any one help me in this?? Please let me know if you require any further info.
 
Old 08-31-2009, 02:56 AM   #2
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
You can use scp to do this. However, you'll need to set up SSH keys on the machines so that scp doesn't need a password (just google for "SSH without password" or something similar).
 
Old 08-31-2009, 04:11 AM   #3
tomklq
LQ Newbie
 
Registered: Nov 2004
Location: Ireland
Distribution: Arch, IPCop, Debian
Posts: 17

Rep: Reputation: 1
If you set up network file sharing between the two systems, using e.g. nfs, samba, sshfs[1], etc, you can mount one system's drive(s) on the other system. Then the only "shell script" youll need is "cp <filename>".

[1] N.B. sshfs will require also SSH keys, as Nylex mentioned above.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to copy one file and to multiple directories using shell script? cebuy Programming 8 03-31-2009 07:04 PM
Huge Data Set Analysis, Shell Script to copy specific HEX Pairs into a separate file telecom_is_me Programming 11 06-29-2008 10:48 PM
Shell script to copy file name with part of directory Transition Linux - General 5 01-18-2005 05:40 PM
shell script to copy lines from a file Warmduvet Programming 2 09-14-2004 09:25 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:02 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration