August 8, 201312 yr I have the following directory structure on disk6, and I want to copy all the directories that have a PB in front of the name. Is this possible using a bash script? In this example the Sally Smith directory would be copied but the Polly Pocket and Wendy Wong directory would not be copied. The full directory structure needs to be replicated, and the copied files will end up on a new disk, say /mnt/disk16 /mnt/disk6 2013 2013-01 Jan [2013-01-02] PB Smith, Sally lots of files...... [2013-01-04] PPW Pocket, Polly lots of files...... 2013-02 Feb [2013-02-06] Wong, Wendy lots of files...... 2013-03 Mar 2013-04 Apr
August 23, 201312 yr My router has dd-wrt on it and has a very complicated looking vpn section. Definitely not my field, would really apoeciate your help with that but if the wol would work over wan that would be far simpler.
August 23, 201312 yr Author I have the following directory structure on disk6, and I want to copy all the directories that have a PB in front of the name. Is this possible using a bash script? My router has dd-wrt on it and has a very complicated looking vpn section. Definitely not my field, would really apoeciate your help with that but if the wol would work over wan that would be far simpler. Ummm, did you post to the wrong thread??
August 24, 201312 yr Looks like he did post on the wrong thread. His answer, no, WOL (Wake-on-LAN) on WAN port of a router is not going to be a good idea. Your long awaited pointer is the find command. You will have to play with things to make sure, but I think you want to the string " PB " and use the option -type d which will report only directories. Since the string is the directory, not filename, the -name option is not useful, use -path instead. find /mnt/disk16 -type d -path "* PB *" Check the output and pipe to xargs for your copy (cp)
Archived
This topic is now archived and is closed to further replies.