Create a ZIP via script

435 views
Skip to first unread message

TS

unread,
May 20, 2011, 5:12:56 AM5/20/11
to Tasker
Hi Tasker Pro's

First: I know that there is a Pro Group available, but I thought I'd
better ask here first because of the big userbase ;-)

Second:

I would like to have Tasker create a ZIP file of a specified directory
on my SDCard every now and then.

The idea behind this is that this would be easier to sync to eg.
dropbox than some hundred files. The directory it would concern is the
backup of Titanium Backup, but this would not be the only use.

Now, as Tasker is unfortunately not (yet?) capable of adding a whole
directory to a ZIP file, I discovered the possibility to execute
scripts via the Locale Execute plugin.

As Linux has some inbuilt scripting functions for creating ZIP files,
I suppose that this should be possible with Android, too.

Unfortunately, I'm absolutely unexperienced in writing such scripts. I
however found the following resources:

- using Python / SL4a: http://www.calazan.com/how-to-zip-an-entire-directory-with-python/
or http://stackoverflow.com/questions/296499/how-do-i-zip-the-contents-of-a-folder-using-python-version-2-5
- using linux commands: http://lowfatlinux.com/linux-zip-manual.html

Is anybody able to point me to the right direction as how to create a
script which can be executed by Tasker to achieve this? In an optimal
case, it would allow Tasker to pass a variable in order to specify the
path to be zipped.

Any ideas? ;-)

Regards

Matthieu Berthomé

unread,
May 29, 2011, 4:01:27 PM5/29/11
to tas...@googlegroups.com
If you need to sync directories with dropbox there is titanium media sync, Ive had no problem with it so far. If you need other uses for making tasker zip a directory, I'd say script is the way to go, the command to zip files is zip or gzip, I see gzip included busybox, if you're rooted. If you're not rooted maybe you could put the binary somewhere and execute it from there (is that even possible ?)
aftewards for the command line options for gzip look up its man like http://www.manpagez.com/man/1/gzip/
Cheers

TS

unread,
May 30, 2011, 7:24:36 AM5/30/11
to tas...@googlegroups.com
Hi Matthieu

Thanks for your inputs. I'm already using Titanium Media Sync, but find it quite difficult to tell if all files are uploaded or not (I have more than 500 files in that directory and they're changing all the time). 

I will have a look at the gzip command, thanks.

regards
Reply all
Reply to author
Forward
0 new messages