LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 08-07-2009, 03:23 AM   #1
spkandy
LQ Newbie
 
Registered: Aug 2009
Posts: 2

Rep: Reputation: 0
secure copy a latest data file from the remote host


Hi All,
Greetings for the day..

I just want to secure copy a latest data file from the remote host.
Is there any option available in 'SCP'?
I am using ssh key-authentication, so SCP/SSH is the only option.
Please help me..

Cheers,
Kandy
 
Old 08-07-2009, 03:30 AM   #2
Simon Bridge
Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 197Reputation: 197
Here is a highly readable ssh tutorial which includes how to use scp to copy files over a network.
http://suso.org/docs/shell/ssh.sdf
 
Old 08-07-2009, 04:40 AM   #3
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
The server on the remote host determines whether your public key is used, or if you use a username/password. Do you have a user account on the remote ssh server? Also have a look at sftp. It will allow you to browse to the file, if you don't know its exact name or location.
 
Old 08-08-2009, 02:24 AM   #4
spkandy
LQ Newbie
 
Registered: Aug 2009
Posts: 2

Original Poster
Rep: Reputation: 0
Hi jschiwal,
I am Ok with SSH Connectivity..
Here my concern is How can I transport the latest file of particular pattern created in the remote file system.

Thanks,
Kandy
 
Old 08-08-2009, 02:46 AM   #5
Simon Bridge
Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 197Reputation: 197
scp username@remote.host.net:report.odt report.odt

Lets see if I get this, your problem is that you want to transfer across, say, all the files *.odt and scp username@remote.host.net:*.odt *.odt doesn't help?

http://kb.iu.edu/data/agye.html

what about:

username@remote.host.net:"*.odt"

However, maybe your issue is that scp asks for a password each time it fetches a file from the pattern?
http://forums11.itrc.hp.com/service/...hreadId=961807

[reread]your post indicates that it is only one file you want to transfer. Is it that you want to download the file with the most recent timestamp from a collection? Or perhaps there are a list of files:

report-<date>.odt

and you want the one with the most recent <date>?

How the pattern is managed will provide the specific reply.

You could just fetch "report-*.odt", but maybe there have been several updates? You also don't want to download all the reports you already have all over again.

In general, this will involve writing a script.

scp -p remotehost:"report-*.odt"

once the file has downloaded, chmod u-w so that the next invocation of scp won't over-write and re-fetch the same file. The "-p" option will preserve the access times so you can see what the latest version is.

Last edited by Simon Bridge; 08-08-2009 at 03:06 AM. Reason: had to noparse anything with @ in it
 
  


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
CUPS error: Remote host did not accept data file NoUse4ANick Linux - Networking 5 01-24-2011 04:00 PM
How to copy a file securly to remote host in JAVA waqasdaar Programming 1 02-03-2009 04:56 AM
[SOLVED] analyze data from remote host aihaike Linux - General 6 10-19-2008 04:14 PM
Remote Secure Copy kalyanofb Programming 2 04-20-2007 07:32 AM
how can i secure file copy from pc to pc b123coder Linux - Networking 8 11-20-2004 03:56 PM


All times are GMT -5. The time now is 04:46 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