Powershell copy vs move cmd - powershell

I'm running into some issues with my existing powershell script that copies data from a remote location into a local folder - that local folder also happens to be sync'd with google drive for desktop.
I'm seeing incomplete files being uploaded etc. In order to combat this I think it would be easier/better to change where the initial remote > local is putting its files, and instead of copying directly into the sync folder - copy into a temp/staging location that's NOT the sync folder.
Once that process is complete then use the powershell move-cmd to simply 'move' which will just update file locators to be that of the sync folder.
I think this will solve my issue.
Anyone see any problems with this approach?

If you have ruled out device connectivity, multiple files being uploaded at once vs. a single file being uploaded, and mobile device app or internet browser there is nothing wrong with your approach. If you need anymore assistance please reply to this thread or mark this as the answer.

Related

Keep VS Code from creating new directories when file system unmounts

I am running VS Code on a Windows machine running Ubuntu on WSL 2 that mounts a remote drive from a Linux server using FUSE. This allows me to edit comfortably on VS Code while I run the documents on the server and it generally works great. However, if I am editing and my computer loses its Internet connection briefly, the FUSE mount is lost. If I am in the middle of editing and don't notice, then when I save it, VS Code will see nothing in the directory and create a bunch of directories and save the file locally, which is not what I want to do.
For example, I might be editing a file that is in the mount folder, which is the remote mount. I work on the file mount/somedir/somedir2/someFile.txt. If the Internet connection drops, the remote filesystem is unmounted. If I click Ctrl-s, then VS Code sees only an empty folder called mount. It then creates a somedir directory, then a somedir2 directory, then a someFile.txt file, and saves it there. It is often some time before I catch the problem, and while it is resolvable, I end up with multiple versions of the same file (one on my computer and one on the server) and rationalizing the two is a pain and, if I do it wrong, can end up with me losing work and data (which has happened).
Is there a way to tell VS Code to give an error message when attempting to save a file to a suddenly nonexistent directory, rather than creating it automatically for me? That would make my life much easier.

How can I change VS Code Remote Server's default download folder?

I often download file from vscode remote server, but how could I change default download folder? It always opens a specific folder I don't want to download into.
I don't know about configuring the detault download directory, but there was an issue created and resolved to get VS Code to Remember target directory when downloading files #140358, which was implemented in commit ca936dc.
bpasero (one of the VS Code maintainers) commented to close that issue as resolved:
For the "Download" command we now remember the path where to download and restore that. This information is stored globally (i.e. applies to all windows) but will not roam via settings sync, because paths are typically machine local.
Previously we did a questionable computation of a default path that typically always ended up in the user home directory, which imho does not make a lot of sense for the download operation.
Verification:
connect desktop to any remote
right click from the explorer "Download"
pick a destination
repeat and verify the destination restores even across restarts

Why does VScode delete code permanently when working remotely?

Question's in the title.
I got me curious since, when working locally, deleting files sends them to the trash bin.
When working remotely, is there no way to send a file to either the local or the remote trash bin?
Is there a technical reason this basic feature is missing, or is it just a feature not implemented yet?

How to get FTP-Simple working in Visual Studio Code?

I recently opted to start using Visual Studio Code. I want to connect to a remote server and edit files directly on the server. FTP-Simple seems like a great solution. But I am having a hard time understanding some basics about the program.
If I make a connection to a server, does FTP-Simple download all the actual files to my hard drive?
Also, I was able to make a connection, but in one of the directories there should be a sub-directory and it's missing. What am I doing wrong?
Can someone point me to some good documentation for this extension such as video(s), etc.
If I make a connection to a server, does FTP-Simple download all the
actual files to my hard drive?
Yes, It download all to your hard drive. you can find an address like below:
C:\Users\your user name\AppData\Roaming\Code\User\ftp-simple\remote-workspace-temp\cbc1ad9ed60f12ec861052806d7833db\httpdocs
for opening a directory in VSCode you can press F1 type ftp-config then click ftp-config:Open
and click on target directory you want to open for more information use this
2 years later and I'm having the same problem. I have already uninstalled ftp simple as well as VSC with no effect.
The plugin just doesn't download all the files on the FTP. It worked the first time I installed it for 2-3 weeks and then suddenly stopped being in sync with the FTP server.
There is a folder called "code" on mac in Library/Application Support where most of VSC data is saved, but deleting this didn't have an effect either. Perhaps it works for someone else, as this is apparently necessary to fully deinstall VSC.
I'd pay for good plugin that just allows to work remotely on ftp files!!

Synchronizing with live server via FTP - how to FTP to different folder then copy changes

I'm trying to think of a good solution for automating the deployment of my .NET website to the live server via FTP.
The problem with using a simple FTP deployment tool is that FTPing the files takes some time. If I FTP directly into the website application's folder, the website has to be taken down whilst I wait for the files to all be transferred. What I do instead is manually FTP to a seperate folder, then once the transfer is completed, manually copy and paste the files into the real website folder.
To automate this process I am faced with a number of challenges:
I don't want to FTP all the files - I only want to FTP those files that have been modified since the last deployment. So I need a program that can manage this.
The files should be FTPed to a seperate directory, then copy+pasted into the correct destination onces complete.
Correct security permissions need to be retained on the directories. If a directory is copied over, I need to be sure that the permissions will be retained (this could probably be solved by rerunning a script that applies the correct permissions).
So basically I think that the tool that I'm looking for would do a FTP sync via a temporary directory.
Are there any tools that can manage these requirements in a reliable way?
I would prefer to use rsync for this purpose. But seems you are using windows OS here, some more effort is needed, cygwin stuff or something alike.