INSTALLATION DOCUMENTS BY RAVI

Tuesday, June 13, 2017

Batch file for copying files from windows to linux without prompting for username and password

General syntax for copying a file from windows to linux:

1. On windows open command prompt and issue below command










here servername : linux host name or ip address

2. It will ask for username and password and ones they provided connects to linux machine

3. Issue below command to copy a file from windows to linux





It will copy 1.txt file to linux machine

4. To copy multiple files issue the below command






It will copy all the files to linux machine

Note1: Top copy files from a directory , first navigate to that directory in command prompt and then ftp to linux machine and then issue put and mput commands

Note2: Through ftp we can copy files only.

Batch file for copying files from windows to linux without prompting for username and password:

1. Open a text file on windows and paste the below code in it

@echo off
REM Make a text file with username , password and ftp command
echo username>> test.txt
echo password>> test.txt
echo mput * %1>> test.txt
echo quit>> test.txt
REM Ftp to linux machine by passing the test.txt file
ftp -n -s:test.txt servername
REM Deleting the test.txt file

del test.txt
pause


Here 
username : user name of the linux machine
password: password of the linux machine
servername : linux machine host name or ip address

2. Save the file with .bat extension

3. Double click the bat file and it will copy the files to linux machine




No comments:

Post a Comment

Loading xml file data to oracle table using python

Sample xml file (test.xml): <?xml version="1.0"?> <data>     <customer name="Ravi" >     ...