Last post Jan 15, 2014 01:57 AM by Shawn - MSFT
Jan 08, 2014 12:30 AM|SonitaD|LINK
I do not know whether this is the correct place for this post or not, but I didn't find any other forum related to this. In our project there is one application in Java which uploads files and saves files on a Linux machine. Then we are manually moving the
files to a Window server, where another application developed in ASP.Net is running. This application reads the files and shows the data in dashboard.
Please let me know if this manual moving of files can be done using ASP.Net or is there any other way so that the ASP.Net application can read those files. Can web services be used in this case?
Thanks and Regards,
Jan 08, 2014 02:13 AM|rachel smith|LINK
for manual moving, backup your linux files and upload in ASP.NET.
Jan 15, 2014 01:57 AM|Shawn - MSFT|LINK
For this issue, it's related to move files from linux to windows server. There are many ways to move files between Unix and Windows: secure copy (let's not even think about ftp), shared drives, and file synchronization.
For secure copy, we have scp and sftp commands. Native to Unix systems, both commands are available for Windows as well. I use pscp (PuTTY's scp) which you should find in your PuTTY folder (e.g., C:\Program Files\PuTTY or C:\Program Files (x86)\PuTTY)
if you have PuTTY installed. I make sure the folder is in my Windows search path so that I can access it from any directory and then run commands that work just like scp on Unix:
C:\User\shs> pscp myfile.txt shs@unixserver:/home/shs
Works like a charm. The command will ask for your password and move the file or files specified. Wild cards are acceptable. Just remember that text files moved from Windows to Unix systems will retain their carriage returns and those coming in the opposite
direction will lack them.
Another option for moving files between Unix and Windows systems it to make a drive or folder available by "sharing" it. Both Unix and Windows have commands for this. To share files between the two types of systems, you can use Samba. Samba is an implementation
of the SMB/CIFS networking protocols. So it runs on a Unix system and allows Unix directories to be accessed by Windows systems or Windows shares to be mounted on Unix systems.
To set up shared directory on a Linux system, you have to add a section to your samba configuration file describing what you're sharing and how. You will have different settings depending on what you are sharing and its sensitvity. In general, home directories
should be available to their owners and public directories available to everyone. However, this doesn't mean that you shouldn't limit who can access anything on the server. "Everyone" might mean everyone on a particular subnet or in a particular group.
Other settings in the smb.conf file allow you to limit who can access Samba shares to specific hosts or IP ranges.
Shares set up in the Samba configuration file (smb.conf) will look like what you see below. Most section labels (e.g., "public") serve as the mapping name. The /shares/public folder shown below, for example, can be mapped on a Windows system with the command
"net use P: \unixhost\public" where P: is an available drive label, unixhost is the name of the Unix server, and public is the label we set up in the smb.conf file. The label "homes", however, is a special one in that it tells the Samba service to allow home
directories to be shared. Each user can then map his or her own home directory on their Windows systems.
comment = Home Directories
browseable = no
read only = no
create mode = 0750
path = /shares/public
public = yes
writable = yes
create mask = 0777
browseable = yes
Samba also allows you to mount Windows shares on your Unix server. Sometimes it's easier to mount a shared Windows drive, copy the files it needs, and then unmount the drive than it would be to make this happen from the Windows side.
To mount a Windows share, you would use a command like this:
mount -t smbfs -o username=remuser,password=abc123NOT //windowshost/datafiles /mnt/datafiles
In this command, /mnt/datafiles is a mount point we're setting up to move the files we need, remuser is the name of a user recognized by the Windows system, abc123NOT is his password (please use better passwords!), and windowshost is the name of the remote
From the Windows side, you can view what is being mapped and what is being share with the "net use" and "net share" commands.
Copying files with rsync has the distinct advantage of great performance since rsync smartly copies changes in files rather than complete files whenever that's an option. This means that, if a single byte has been added to the source file, a single byte
will be transferred to the destination.
Rsync can be used to copy files from one system to another, but it's meant to keep files synchronized between systems. You may be familiar with using rsync between Unix systems, but versions of rsync are available to synchronize files between Windows and
Unix systems too. Check out Grsync for Windows systems at sourceforge --
For more information, you could refer to: