smbclient-发送目录中的所有文件 [英] smbclient - Send all files in directory
本文介绍了smbclient-发送目录中的所有文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我创建了一个Shell脚本,用于通过sbmclient将Linux上的文件发送到Windows.
I created a shell script to send files on Linux to Windows via sbmclient.
smbclient //HOST_WINDOWS/D$ -U USER --pass PASSWORD -c "put /tmp/test.txt FOLDER_WINDOWS/test.txt"
那很好.
smbclient //HOST_WINDOWS/D$ -U USER --pass PASSWORD -c "put /tmp/* FOLDER_WINDOWS"
我想一次发送所有文件,可以吗?
I would like to send all files at once, is it possible?
推荐答案
我发现只有当本地工作目录等于您要上传的目录时,它才能可靠地工作.
I found that it only works reliably when the local working directory is equal to the directory that you want to upload.
但是可以指定本地目录:
But it's possible to specify a local directory:
smbclient //HOST_WINDOWS/D$ -W domain -U username \
-c 'prompt OFF; recurse ON; cd remote/target/directory; lcd /local/source/directory; mput *'
在交互模式下,我想看起来像这样:
In interactive mode I guess that would look something like this:
smb: \folder\> recurse ON
smb: \folder\> prompt OFF
smb: \folder\> lcd /local/source/directory
smb: \folder\> cd remote/target/directory
smb: \folder\> mput *
这篇关于smbclient-发送目录中的所有文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文