secure copy a latest data file from the remote host
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..
Here is a highly readable ssh tutorial which includes how to use scp to copy files over a network.
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.
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.
scp email@example.com: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 firstname.lastname@example.org:*.odt *.odt doesn't help?
However, maybe your issue is that scp asks for a password each time it fetches a file from the pattern?
[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:
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.
|All times are GMT -5. The time now is 03:59 AM.|