Link to home
Start Free TrialLog in
Avatar of losforword
losforword

asked on

Linux Samba Map

I need to mount the windows share in Linux box for file transfer and unmount the share after the file transfer in place in single script

assume that windows share is on h-web0.kiro.sys/myshare

and now the files in Linux system are under  /var/www/fedu/hidden/*.sys

Avatar of torakeshb
torakeshb
Flag of India image

Provide more details and your requirement
Avatar of Julian Parker
perhaps something like; (untested)

#!/bin/bash
USERID=windowsusername
PASSWORD=windowspassword
LOCALMOUNT=/mnt     # change this to mount where you want it locally

mount -t cifs -o username=${USERID},password=${PASSWORD} //h-web0.kiro.sys/myshare ${LOCALMOUNT}

find /var/www/fedu/hidden -name "*.sys" | cpio -puvdm ${LOCALMOUNT}

umount ${LOCALMOUNT}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Gerwin Jansen
Gerwin Jansen
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial