So i’ve been trying to pull this together for sometime. Used different methods, and also found some partial answers, but none of the answers i found here worked or only answered part of the problem, or similar problems..
I have a folder multiple files with this structure:
nameXX.tar.gz
md5nameXX.txt
debugnameXX.txt
nameYY.tar.gz
md5nameYY.txt
debugnameYY.txt
Etc...
And so on, as you can see the only portion of the file names that changes is the XX, YY etc
What i need is to create a script that will move all files that match the XX, YY etc.. into a folder with the same name.
So for example i would like to move all the,
nameXX.tar.gz ,
md5nameXX.txt,
debugnameXX.txt
All those would move into a folder named nameXX
In detail those are backup snapshots. Each backup snapshot creates 3 files. buckup-TIMESTAMP.tar.gz ; md5backup-TIMESTAMP.tXT; debugbackup-TIMESTAMP.txt. All i need is a script that moves all 3 files in the same folder named backup-TIMESTAMP. In resume the YY or XX represent different timestamps. –
Thanks for your help