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

Advertisement

poojanwagh
Joined:
Posts:
4

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

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 (<invalid hyperlink removed by admin>) advocate the use of rsync & the UNIX
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
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 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. :D[/b]

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.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,454
Location:
Prague, Czechia

Re: How does WinSCP handle over-writing a hard-linked file?

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.

Reply with quote

Advertisement

You can post new topics in this forum