LinuxQuestions.org
Visit the LQ Articles and Editorials section
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
 
LinkBack Search this Thread
Old 08-14-2004, 09:59 PM   #1
jeempc
Member
 
Registered: Mar 2003
Location: Ann Arbor, MI
Distribution: Slackware 10.1
Posts: 119

Rep: Reputation: 15
using scp in a script


I would like to write a script that will tar a directory and scp it to another one of my machines.
I am not sure of the syntax for scp to do this in a script.
I also realize that my password will probably be in clear text in the script but I don't care.
Anybody know how to do this?
Jeem
 
Old 08-15-2004, 07:29 AM   #2
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 64
You can use:
scp /path/to/source/file.tar user@machine:/path/to/destination/

Take a look at my LinuxAnswer on public key authentication with ssh, that will save you having to store a plain text password.
 
Old 08-15-2004, 09:47 AM   #3
jeempc
Member
 
Registered: Mar 2003
Location: Ann Arbor, MI
Distribution: Slackware 10.1
Posts: 119

Original Poster
Rep: Reputation: 15
Thanks and for everyone else I found this.

http://www.linuxgazette.com/issue98/dsirof.html
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
scp does not work and gives the following error message: scp: FATAL: Executing ssh1 i akay Linux - Networking 16 09-28-2008 11:41 PM
NFS or SCP in a script rooch84 Linux - Software 7 09-01-2004 10:50 AM
What is SCP? radam Linux - Software 2 07-20-2004 07:07 PM
Shell Script with ssh & scp ErikJohnson Linux - Software 3 03-11-2004 04:53 PM
Shell Script with ssh & scp ErikJohnson Linux - Networking 1 03-11-2004 04:14 PM


All times are GMT -5. The time now is 03:53 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration