![]()
PUTTY DOWNLOAD COPY DIRECTORY DOWNLOADSo you can download the files from old server to new server. One way to solve this is setting up a web server or ftp server. An internet connection can be unpredictable at times, and a sudden drop of the connection while downloading a large file can be frustrating. If you want to transfer one file to another server, which is not located in the same local network. Usually, the db files are about hundred gigabytes. Sometimes we need to copy very large file from one server to another, like database migration. If you don’t know how, it’s better to ask here. If thenĮcho "remote folder $remotePath/$folder does not exist"īy using this script, please make sure that you can ssh to the remove server without password. #sub-folders what to copy from remote path to local pathĮcho "target folder $localPath does not exist!"įor folder in create folder if not existĮcho "$localPath/$folder does not exist, mkdir"Įxist=$(ssh "&echo 1||echo 0")Įcho "remote folder $remotePath/$folder exist, start to copy"įor file in $(ssh "cd $remotePath/$folder ls ") ![]() PUTTY DOWNLOAD COPY DIRECTORY CODEI also add some checking code before downloading. The latest script will allow us to set remote path, local path, and the sub-folders to download. To improve the script, I add several features in the script. Here is the example code:īest Script to SSH Download Thousands Files from Remote Server to Local Meanwhile, it will check if the file exists. Instead of downloading the whole folder, the script will download the file one by one from the remote. Download Big Folder from Remote Linux to Localīasically, the script will still take the advantage of ssh and scp command. This is the reason to cause me writing a script to download big folders which has thousands of files from remote Linux to my local Windows or Linux. If I repeat the above command, it will start from the beginning and it still has a risk of network disconnection. I got a message about “the connection is reset by remote server”. It took around 3 hours to download around 1k files, then the download process was broken. However, I am facing a big problem today when I download a folder with 10k files inside. This command is very efficient when the folder size is small. For example, I want to download the folder “a” from remote Linux to Windows with “scp”. PUTTY DOWNLOAD COPY DIRECTORY INSTALLIt will be available when we install the putty client. The simplest way to copy folder from remote Linux to Windows is by using “scp”. ![]() I am using the “Git Bash” which is installed when I install the Git client in Windows. For executing Linux bash script on Windows, there are lots of way. First, it’s usually running a batch file (.bat file) on Windows, but I am not familiar with batch file. ![]() Today, I will share a simple bash script which helps to copy the folder with thousands of files from remote Linux to my Windows laptop. Sometimes it’s too busy for me, but most of the time, I was just too lazy to write. I don’t have time to write tutorials for a long time. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |