You can always add these commands to a shell script or crontab to automate the process. $ scp /home/ubuntu/data.txt the file “foobar.txt” from a remote Windows host to the local Linux folder. $ scp /home/ubuntuĬopy file foobar.txt from local Linux folder to remote Windows folder /data. $ scp /home/ubuntu/* the other hand, if you want to copy files from remote Windows system to local Linux folder, just swap the source and destination in above command. Here is a simple command to copy files from local folder /home/ubuntu in Linux to remote folder /data on Windows. But you need to have it installed on both systems with SCP user defined in Linux system, with access to Windows system. 0 10 * * * /home/ftpuser/movefiles.sh >/dev/null 2>&1Īlternatively, you can also use commands like SCP to transfer files from Linux to Windows. $ crontab -eĪdd the following line to run the script everyday at 10.a.m. You can also create a cronjob to run this script regularly. Then we use mput command to copy all files from local folder to remote folder. We also navigate to /export/home/ftpusers/files folder on local system. We use cd command to navigate to folder upload on remote system. Then we call ftp command to connect to the FTP server on Windows system. In the above code, we have stored FTP HOST, USERNAME and PASSWORD to connect to Windows system. $ vi /home/ftpuser/movefiles.shĪdd the following lines to it. For this purpose, we will create a shell script movefiles.sh on Linux system. Using this user, we connect from Linux to Windows system, copy files from one system to another. Basically, we have assumed that you have an FTP user ftpuser that allows you to connect from Linux to Windows. Here are the steps to copy files from Linux to Windows. In this article, we will learn how to copy files from Linux to Windows. Often system administrators need to transfer files across different platforms such as Linux and Windows.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |