I got a few hundred folders, all with the same name structure, ##* , I need to backup with rsync all the folders within 00 to 15_ range to a drive and 16_ to 99_ to another drive. How can I filter the each list to pass this to rsync?.
drwxrwxrwx+ 10 user user 4096 Feb 16 2017 07_MrSmith
drwxrwxrwx+ 3 user user 4096 Mar 24 12:55 10_Other_File
drwxrwxrwx+ 4 user user 4096 Aug 23 14:33 15_New_Interesting_folder
drwxrwxrwx+ 9 user user 4096 Aug 31 17:23 16_SimpleFolderNaming
drwxrwxrwx+ 3 user user 4096 May 8 12:53 17_VeryCurious
drwxrwxrwx+ 6 user user 4096 Mar 28 12:38 17_MantinanVinil
drwxrwxrwx+ 3 user user 4096 Mar 28 11:47 17_AnotherFolderWith_Subfolders
I tried looking for parameters of the 'find', 'xargs' or 'rsync' command that allows to compare subsets with numbers, but I can't find a solution to this.
When I do:
find -maxdepth 1 -regextype posix-extended -regex '..[0-1][0-5]_*'
to filter the folders within 00-15 range doesn't returns anything.
_*is 0 or more underscores. ITYM,_.*(underscore followed by 0 or more characters).[0-1][0-5]doesn't match on06