-CentOS Linux release 7.6 · Windows Server 2019
#Check if the samba client is installed
rpm -q samba-client
#Install samba client
yum install -y samba-client
#Access Windows shared folders with samba
#「smb: \>Is displayed, access is successful
#Exit samba connection with "exit"
smbclient '\\Windows IP address\Shared folder name' -U domain name\\username%password
smb: \>put Linux data path File name when putting on Windows
smb: \> exit
#! /bin/bash
# /var/Under log.For log files
for filePath in `find /var/log/*.log`; do
# -send put command with c
smbclient '\\Windows IP address or PC name\Shared folder name' -U username%password-c "put ${filePath} ${filePath##*/}" >&1
#Delete the data on the Linux side if you do not need it
rm -f $filePath
done