I am trying to copy the content from my source folder to mounted destination folder. What I did is i was mounted 4 devices by giving the ip to /etc/fstab
.
//192.168.100.1/C1 /media/Client_1 smbfs guest 0 0
//192.168.100.2/C2 /media/Client_2 smbfs guest 0 0
//192.168.100.2/C3 /media/Client_3 smbfs guest 0 0
//192.168.100.2/C4 /media/Client_4 smbfs guest 0 0
and then by using python script,I am trying to copy the files to all Client_1,Client_2,3 and 4 folders.The below line is used to copy the file to mounted folders.
os.system("cp -f sourcepath/* /media/C1" %locals())
os.system("cp -f sourcepath/* /media/C2" %locals())
like C3 and C4 folders
The file is moving properly. But, the problem is if any network issues are happened while copying the content the script will not move to next line, the process is waiting until the network come back again. Out of 4 mounted device if suppose C2 has a problem, the script terminate the c2 and try to move the content to c3 and c4. I am struggling this place. If you know let me.
Note: I can understand -f means force, if an existing destination file cannot be opened, remove it and try again . What argument i need to use for copy the content to mounted folder, if any network issues happen, it need to terminate that copying folder.