Мне нужно создать пакет, который регулярно копирует файл file.txt с удаленной машины Windows (находится в \ 1.2.3.4 \ Client $) на машину Linux, расположенную в 7.8.9.10. Пакет должен работать на машине Linux. Какой самый простой способ сделать это?
2 ответа на вопрос
1
Rich Homolka
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 //1.2.3.4/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 //1.2.3.4/Share -c 'get /file /dest/dir1'
Schedule this in cron.
1
KronoS
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
Select: Commands --> Keep Remote Directory up to Date...