I am transferring file to Windows server from Ubuntu with following command:
smbclient //server_ip_add/share -U username
We can use rsync
to transfer file from Ubuntu to Ubuntu and then by creating script run it as cronjob. Is it possible to do all this from Ubuntu to Windows?
I used MountWindowsSharesPermanently method to transfer file via rsync automatically.
First I mount a windows share folder (or map network drive) to which i want to transfer file with following method:
then use rsync to transfer file:
Create script,make it executable and schedule a cronjob.
Now if you reboot the system, it will be unmounted. So to mount it permanently, do following:
Open terminal & run:
Edit:
Here
.smbcredentials
is a credential file created in home directoryTo create it, run
gedit ~/.smbcredentials
Edit:
save & close it.
UPDATE: For Ubuntu 16.04.3, and 18.04, edit
vers=1.0
There is a tool for Windows that implements
rsync
. It is called cwrsync and is published by itefix.It has packaged
rsync
andcygwin
with the sole purpose to give a simple solution to installrsync
on windows.This link gives a step-by-step description of how to set it up and how to use it.
Obviously, itefix publish their own documentation.
I've used it successfully to copy 2GB+ of attachments over from a Ubuntu server to an IIS7 server. The attachments were part of a database application.