Exclude file types in smbclient tar
I've got a relitivly simple bash script that tries to connect to a remote computer on the network, if it finds the other computer, it runs the line
smbclient //$domain/$dir -A $authFile -TXc $bakDir$domain$us$dir.tar /My\ Documents/My\ Music This sucessfully does the backup and excludes anything in the 'My Music' directory, however, while testing the bash script on my girlfriends machine, I realized that I REALLY need to be able to exclude certain file types (such as avi, mp3, ogg, mpg, wmv, etc) and I'm wondering the correct syntax. I set up a little test area and tried the following which did not work: smbclient //fake_comp_name/bt -A /mnt/hdb/.adrong.bak/auth.txt -TXc /home/adrong/tmp.tar *.avi *.mp3 thanks for any help. |
It took some digging to find the answer...
I needed to also use the regular expression parameter 'r' (although this is a misnomer as they only support '*' and '?') so my above (non working) line becomes smbclient //fake_comp_name/bt -A /mnt/hdb/.adrong.bak/auth.txt -TXrc /home/adrong/tmp.tar *.avi *.mp3 The resource that I used warned that if Samba was not compiled with the 'HAVE_REGEX_H' parameter, you'll have some performance issues. |
All times are GMT -5. The time now is 09:35 PM. |