Bash command to archive nested directories into individual archives

In Progress Posted 6 years ago Paid on delivery
In Progress Paid on delivery

I need someone to figure out the syntax for a bash command that will run in the Mac OS X Terminal and execute the keka7z program to archive the files within the current directory tree into individual archives, one archive per subdirectory, while preserving the original directory structure.

An example directory tree:

\file1

\file2

\file3

\directory1\file4

\directory1\file5

\directory1\directory2\file6

\directory1\directory2\file7

\directory1\directory3\file8

\directory4\file9

\directory4\file10

Running the command in this directory would produce five total 7z archives:

root.7z (containing file1 file2 file3 with no path)

directory1.7z (containing file4 file5 with path \directory1)

directory1_directory2.7z (containing file6 file7 with path \directory1\directory2)

directory1_directory3.7z (containing file8 with path \directory1\directory3)

directory4.7z (containing file9 file10 with path \directory4)

This command should archive only the files found in each directory into each unique archive file. Extracting all five archives in the above example would yield the original directory structure. Empty directories would be ignored (not create empty 7z archives).

The command should also include the command line options to use "Store" compression (-mx0) and volume segmenting of 4480MB (-v4480m) and stop or warn the user if it attempts to overwrite any existing files (for example if there is already a root.7z etc).

The path to the keka7z executable on my system is

/Applications/[login to view URL]

If there is a way to automate this further or make it easier to use I would be open to additional milestones once the basic function is accomplished.

Bash Scripting Mac OS UNIX

Project ID: #15009630

About the project

5 proposals Remote project Active 6 years ago

5 freelancers are bidding on average $41 for this job

gangabass

I can create MacOS executable (not a bash script) which will archive nested directories into individual archives just like you described. Relevant Skills and Experience The program will accept command line options to More

$100 USD in 1 day
(25 Reviews)
4.8
ichthyocentaurs

Hello! Task are simple! The app you mention is GUI for p7zip. Thus you need just a console script or you also need a some GUI?

$20 USD in 3 days
(4 Reviews)
2.8
cguerrac

i will provide a script with comments in order to understand the process of script.

$30 USD in 3 days
(2 Reviews)
1.6
priyanka6432

I done the same scripting. So i have similar code. I will do it fast. Relevant Skills and Experience BASH. experience: 4 years in Bash Proposed Milestones $25 USD - write the script to extract one file from zip. chec More

$25 USD in 1 day
(0 Reviews)
0.0