I have large directory that contains several millions+ sub-dir, each sub-dir contain 3 or less image files. What is the most efficient way for me to zip them so I can move it to a new server?
The sub-dir are 5 letter words compose of random letters + numbers.
For ex:
/foo/re63d/image.jpg, /foo/re63d/image2.jpg
/foo/4sf3g/image.jpg, /foo/4sf3g/image2.jpg
/foo/vj33s/image.jpg, /foo/vj33s/image2.jpg
and so on several millions times
I was thinking of using shell script to zip/tar them alphabetically. For ex every folders starting with
00* zip them into 0_0.zip
01* zip them into 0_1.zip
a0* into a_0.zip
a1* into a_1.zip
aa* into a_a.zip
This way it's easier for me to manage them. I want to be able to choose what sub section I want to zip at a time like aa* to af* as I want to be able control how long each process run. How would I go about doing this?
rsync
would be a better tool. – nxnev Dec 21 '18 at 23:34rsync
is rock solid and will continue where it left off when there is a broken connection and has a compression algorithm built-in – Fabby Dec 21 '18 at 23:48