How can I move the files from unix path to windows network shared path and the file should be moved to respective folder in shared path and if not then it is to create a folder based on file name and should move it.
Can you please answer me.Thanks
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
You could use
CIFS for that, which under Debian is known as the
cifs-utils package. That way you can mount a samba/cifs share onto your Linux machine and let a script to the rest. A mount would look like:
/sbin/mount -t cifs -o user=<WindowsUser>,password=<WindowsPassword>,uid=<UIDtoOwnFilesOnLinux>,gid=<GIDtoOwnFilesOnLinux> //WindowsMachine/Shared/Folder /mount/point/on/linux
Where especially the
password option should be considered twice as this would mean clear text password - without it you should be prompted for
<WindowsUser>'s password on
Note that you will have to be
root to do the mount unless you e.g. add the command to the
sudoers file (or preferably to the
/etc/sudoers.d directory). This should look like:
#file stored as e.g. /etc/sudoers.d/remoteaccess linux_user ALL=NOPASSWD: /sbin/mount -t cifs <and so on: command exactly as above!>
And would allow to execute this very command.
Make sure to use
visudo for changing the file and
visudo -c to check your sudoers!
You should install Samba. I believe the command is
sudo apt-get update sudo apt-get install samba
Windows, unfortunately, uses Samba as the network sharing protocol. I've just literally uninstalled Debian from a machine that was using Samba, so I'm sure if you click on the Nautailus file jobby, and select browse network, it will show the share and you can browse to it.