Topic "How does WinSCP handle over-writing a hard-linked file?"

Author Message
poojanwagh
[View user's profile]

Joined: 2008-08-20
Posts: 4
Does WinSCP delete (de-link in the case of hard-links) files before uploading? If not, can this be made an option?

I am trying to do remote self-contained incremental backups using WinSCP.

Several places (http://www.mikerubel.org/computers/rsync_snapshots/#Incremental) advocate the use of rsync & the UNIX
Code:
cp -al
to make compact incremental backups.

However, in order to do so, new backups must make sure they do not over-write hard-linked files. For example, if I:
1. upload a file b.txt to the directory remote:latest/b.txt (using WinSCP in SFTP mode)
2. do a
Code:
cp -al latest old
(on the remote host)
3. Screw up the b.txt file locally
4. Upload the (corrupted) b.txt file to the directory remote:latest/b.txt again (using WinsCP in SFTP mode)
Then: What is WinSCP's behavior? It can either over-write the file directly (therefore over-writing both latest/b.txt and old/b.txt which references/hard-links-to it). Or, it can de-link (delete) latest/b.txt before uploading.

The reason I ask is that rsync does{/b] de-link the file before writing the new version. That's the behavior that I want with (the much-better-than-rsync) WinSCP.

I've spent about 15 minutes looking through the manual. So, I admit that there might be an option there that I missed. My apologies if this is the case. However, I did make an effort. Very Happy


P.S. Excellent software. I recently battled with rsync for the last couple of days. Finding WinSCP has already saved me a bunch of heartache.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24553
Location: Prague, Czechia
poojanwagh wrote:
Does WinSCP delete (de-link in the case of hard-links) files before uploading? If not, can this be made an option?

It does that optionally. See documentation. Well in fact it optionally uploads file into temporary file. Once the upload finishes, it deletes the original file and renames the temporary one to its name.
_________________
Martin Prikryl
poojanwagh
[View user's profile]

Joined: 2008-08-20
Posts: 4
Excellent! That's what I was looking for (and even better, in fact).
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License