I need to create a batch that regularly copies a file file.txt from a windows remote machine (located at 126.96.36.199Client$) to a linux machine located at 188.8.131.52.
The batch should run on the linux machine.
What is the simplest way to do it?
My guess is that the easiest is to:
Get Windows file sharing working.
Make sure you have the smbclient program on your Linux box. This is usually in a package called samba-client or similar.
Make a script, something like
smbclient //184.108.40.206/Share -c 'get /file /dest/dir1'
Depending on what your permissions are, you may want to add an authentication file, name and password. so it would be
smbclient -a smb_auth.txt //220.127.116.11/Share -c 'get /file /dest/dir1'
Schedule this in cron.
Note: This doesn’t match your requirements exactly
If you can go from Windows to linux instead of the reverse, you can use WinSCP and it’s ‘synchronize folders’ feature:
- Connect to the linux box using WinSCP
Keep Remote Directory up to Date...