Red Hat Training
A Red Hat training course is available for RHEL 8
3.14.3. スクリプトモードでの smbclient の使用
-c
パラメーターを smbclient
に渡すと、リモートの SMB 共有でコマンドを自動的に実行できます。これにより、スクリプトで smbclient
を使用できます。
以下の手順では、SMB 共有に接続し、サブディレクトリーからファイルをダウンロードする方法を説明します。
手順
-
以下のコマンドで共有に接続して
example
ディレクトリーに移動し、example.txt
ファイルをダウンロードします。
# smbclient -U DOMAIN\user_name //server_name/share_name -c "cd /example/ ; get example.txt ; exit"