marcmcconnell
Technical User
I have a question about a loop that I need to create.
I have about 15 directories each containing about 2000-4000 files. I have to create a loop that creates a tar file containing a maximum of 1000 files.
For example directory DIRA contains 2456 files. The loop would create DIRA1.tar containing files 1-1000 in the directory. DIRA2.tar would contain files 1001-2000. DIRA3.tar would contain files files 2001-2456. This would have to happen for all 15 directories (DIRB, DIRC etc..)
I obviously need some sort of a counter and maybe a while loop. Bit of a newbie with loops. Any ideas?
I have about 15 directories each containing about 2000-4000 files. I have to create a loop that creates a tar file containing a maximum of 1000 files.
For example directory DIRA contains 2456 files. The loop would create DIRA1.tar containing files 1-1000 in the directory. DIRA2.tar would contain files 1001-2000. DIRA3.tar would contain files files 2001-2456. This would have to happen for all 15 directories (DIRB, DIRC etc..)
I obviously need some sort of a counter and maybe a while loop. Bit of a newbie with loops. Any ideas?