1.14.4. スクリプトモードでの 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"