recursively move, rename and zip files

105 views Asked by At

I have a folder structure like this

Folder1 Folder2 Folder3 ...FolderXYZ

Each of these Folders contains around 500 files named like

event-yyyy-mm-dd-0001.jpg_backup event-yyyy-mm-dd-0002.jpg_backup ... and

event-yyyy-mm-dd-0001.jpg event-yyyy-mm-dd-0002.jpg ....

I need to copy all *.jpg_backup files from Folder1 Folder2 ... to a new created subdirectory within a diffrent folder Folderexisting, strip the _backup from the filenames, and make a zip with all the renamed files, named after parent directory (e.g. Folder1.zip). The script should be able to do this recursively for all folders. OS is a Debian Wheezy with no GUI.

THX in advance

0

There are 0 answers