The goal is to scp into another server and pull all files matching a format, say 20060408.gz, from all folders in a certain directory, say /home/tmp.
scp -r user@server:/home/tmp/ del/
keeps the file structure intact, but obviously, pulls all files, not just 20060408.gz.
scp -r user@server:/home/tmp/*/20060408.gz del/
-r is ignored in this case and files are copied w/out file structure. Having the same filename, not all of the data is pulled. Also I'd need two scripts in this fashion since /home/tmp contains hundreds of folders containing .gz files, but also one other sub-folder with dozens of folders also containing .gz files. So if the above example worked, I'd also need
scp -r user@server:/home/tmp/*/*/20060408.gz del/
Is there any way to either keep the directory structure and only pull files matching a certain pattern? Or is there a way to force a rename on all copied files (hundreds of files w/ the same name. Doesn't matter naming convention on pulled files, as they will all be parsed out & loaded into a db)?
Let me know if I'm not being clear on the goal. Still on the first cup of coffee. Thanks, all.
scp -r user@server:/home/tmp/ del/
keeps the file structure intact, but obviously, pulls all files, not just 20060408.gz.
scp -r user@server:/home/tmp/*/20060408.gz del/
-r is ignored in this case and files are copied w/out file structure. Having the same filename, not all of the data is pulled. Also I'd need two scripts in this fashion since /home/tmp contains hundreds of folders containing .gz files, but also one other sub-folder with dozens of folders also containing .gz files. So if the above example worked, I'd also need
scp -r user@server:/home/tmp/*/*/20060408.gz del/
Is there any way to either keep the directory structure and only pull files matching a certain pattern? Or is there a way to force a rename on all copied files (hundreds of files w/ the same name. Doesn't matter naming convention on pulled files, as they will all be parsed out & loaded into a db)?
Let me know if I'm not being clear on the goal. Still on the first cup of coffee. Thanks, all.