How to send bash arguments to rar parameters

Joined
Feb 2, 2015
Messages
2
Reaction score
0
I know, I know...it totally sounds off topic, but what I am doing is creating a folder action so whenever a file or folder is dropped on a watched folder, this automator workflow gets called. The automator workflow runs a shell script, it is one line:

cd ~/Dropbox/_SendToOneDrive/;/Applications/rar a -df -ag[MM-DD-YYYY_HH_MM_SS] -m5 -v27600k ~/Dropbox/_SendToOneDrive/ "$@"

That basically takes what is dropped onto the folder, uses rar to chunk the file in to ~27MB files and places the chunks in the "_SendToOneDrive" folder. Once that is done, the file is deleted by the -df switch in rar.

This generates files with names such as:

[02-03-2015_09_45_56].part1.rar

Which sucks as I have no idea what the original filename was.

What I would love is this:

[OriginalFilename-02-03-2015_09_45_56].part1.rar

So I thought I'd try this:

cd ~/Dropbox/_SendToOneDrive/;/Applications/rar a -df -ag["$@"-MM-DD-YYYY_HH_MM_SS] -m5 -v27600k ~/Dropbox/_SendToOneDrive/ "$@"

And of course it chokes and does not work. I have searched on how to do this and I cannot find it - anyone care to shed some light?
 
Joined
Feb 2, 2015
Messages
2
Reaction score
0
Thinking it over, I really could not care less about the date, I'd be happy to be able to use rar to generate names like:

[OriginalFilename].part1.rar
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top