[clug] Moving files between servers
mbp at sourcefrog.net
Wed May 18 23:59:18 GMT 2005
On 19 May 2005, Andrew Pollock <andrew-clug at andrew.net.au> wrote:
> I've got a Solaris-based central file collecting menagerie of shell scripts,
> which currently uses F-Secure's proprietary SSH (hereon in referred to as
> "Shiteful SSH").
> I wouldn't mind replacing this with OpenSSH, except that Shiteful SSH's scp
> command has this blasted -u option, which OpenSSH's scp doesn't have, which
> means all the scripts don't work properly.
> The -u option unlinks the file after it has been transferred.
> So I'm trying to come up with a safe alternative to
> scp -u remoteserver:/somedir/* .
> using either sftp or rsync over SSH or something of that ilk, but the quick
> and dirty options I can think of have all these inherent race conditions in
> them whereby a file that hasn't been transferred is deleted, or there is no
> checking of successful file transfer before remote file deletion.
Maybe you should just add that option to openssh? It should be fairly
trivial, and if you do it in the scp-over-sftp mode then you only need
to update the client.
Otherwise, maybe something like
echo ls | sftp -b - remoteserver > /tmp/files
strip off garbage
for thing in /tmp/files
scp remoteserver:$thing && echo rm $thing | sftp -b - remoteserver
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: Digital signature
Url : http://lists.samba.org/archive/linux/attachments/20050519/4dc2b66e/attachment.bin
More information about the linux