Re: transfer links seamlessly
- From: pk <pk@xxxxxxxxxx>
- Date: Sat, 07 Jun 2008 17:37:55 +0200
On Saturday 7 June 2008 17:21, Anoop wrote:
Hi,
Need some help here.
I had written an ftp script long back to transfer files from a unix
(solaris) box to windows. This script transfers files fine, except at
the time there was no requirement for soft links. Now there are soft
links and I need to figure out a way to incorporate handling of links.
I think I know how to do it, I can run ls on the file, grep and awk on
the -> characters and that would give me the physical file and I can
pass this file for the ftp instead of the link.
But before I go that route I wanted to check if there is an easier and
more foolproof way of doing this. Is there some command I can give
that gives me the actual file name if it is a link? Or better can I
tell ftp (or sftp rather) to always follow links instead of
transferring only the files?
If you can use something other than ftp/sftp, I suggest you take a look at
rsync. It can handle links in a variety of ways, including preserving or
dereferencing them. Start from man rsync, option -L and subsequent ones.
--
All the commands are tested with bash and GNU tools, so they may use
nonstandard features. I try to mention when something is nonstandard (if
I'm aware of that), but I may miss something. Corrections are welcome.
.
- Follow-Ups:
- Re: transfer links seamlessly
- From: Anoop
- Re: transfer links seamlessly
- References:
- transfer links seamlessly
- From: Anoop
- transfer links seamlessly
- Prev by Date: transfer links seamlessly
- Next by Date: Re: Creating a tar file with only files that have changed since a specified date
- Previous by thread: transfer links seamlessly
- Next by thread: Re: transfer links seamlessly
- Index(es):
Relevant Pages
|