R
R
reus2017-06-20 12:44:56
linux
reus, 2017-06-20 12:44:56

Implementing file backup by directory mask?

In general, there are many different files in the media directory and you need to copy files from it in the path of which the mask has /thumbs/ to the media2 directory while maintaining the previous path. That is:
1. Recursively browse the media directory.
2. If the file has '/thumbs/' in the path then copy it from ~/ media /2016-11/23/15/thumbs/6ddb2d6fac7cb46a6b121342143e8f62.jpg to ~/ media2 /2016-11/23/15/thumbs/6ddb2d6fac7cb46a6b121346.143e jpg
And it is better to shove these files into one archive at once.
Example path files:

~/media/2016-11/23/15/thumbs/6ddb2d6fac7cb46a6b121342143e8f62.jpg
~/media/2016-11/29/09/thumbs/9d02a0ddef8425f8aae827d57542093f.jpg
~/media/2016-11/30/09/thumbs/8df7b73a7820f4aef47864f2a6c5fccf.jpg

How would you actually do it?
Or is there no solution in linux and PL + hands to help?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Victor Taran, 2017-06-20
@shambler81

Search for all images and copy them with structure preservation
Finds all images recursively from the current directory and copies them preserving the directory structure to the /tmp/backu folder
Everything can be done in Linux!

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question