I'm running a Bash script under Cygwin, but this question applies more broadly.
I have a remote file: //someremoteserver/somefile.db
That "//" path is under Cygwin--it's essentially a UNC pathname on a Windows network (in this case), so call it Samba.
The file is large: 50 GB.
I want to rename it all on the remote end:
mv //someremoteserver/somefile.db //someremoteserver/someotherfile.db
I would like for this to take 5 nanoseconds because it's merely a rename. But it takes two hours. This seems to be because it is actually copying the file through the local machine's memory space--it's moving 50 GB across the LAN (or maybe even 100 GB if it's copy-here copy-there).
Normally on a local system a "mv" is instantaneous regardless of file size because it's only updating the inode/file table.
Is there a good way to do the same thing when the file is on a remote Samba share?