Deleting all files from folder older than xx time in Tasker 1.1 beta

630 views
Skip to first unread message

Murz

unread,
Jun 20, 2011, 11:50:24 PM6/20/11
to Tasker
In Tasker 1.1 beta I have found new feature:
added: variables %FNAME, %FDIR, %FTYPE, %FSIZE, %FMODS

And I see the action:
added: action File / Delete File

Can I do with those actions task for delete all files from folder,
that have %FMODS greater that some limit?
Or maybe exists some other way to do this?

Pent

unread,
Jun 21, 2011, 3:30:13 AM6/21/11
to Tasker

> In Tasker 1.1 beta I have found new feature:
> added: variables %FNAME, %FDIR, %FTYPE, %FSIZE, %FMODS

Those are currently just set by the Test File action.

> And I see the action:
> added: action File / Delete File

That's not a new action, you cut off the end of the line:

<LI>added: action File / Delete File: added Shred Level parameter

> Can I do with those actions task for delete all files from folder,
> that have %FMODS greater that some limit?
> Or maybe exists some other way to do this?

Nearly.

You can do:

Test File %FILETODELETE
Delete File %FILETODELETE [IF %TIMES - %FMODS > 60]

But there's currently no way to get a list of files and iterate over
them. We're getting closer though :-)

Pent

Richard Kemp

unread,
Jun 21, 2011, 7:04:23 AM6/21/11
to tas...@googlegroups.com
Using the locale execute plugin:

@find /sdcard/folder -mtime +90 -e

This is a command I use to delete old backups, if I recall correctly it deletes (the -e specifies to delete) files in folder which were created >90 days ago. To test it you can go to a terminal and type the command without the @ at the start (this tells locale execute plugin not to flash up a message telling you it ran the action) and the -e at the end (which would delete the files - without this it just shows matches). If you want something other than date created, change -mtime to something else. google for ' unix find man page ' or similar to find possibilities.

All the best.

brandall

unread,
Jun 21, 2011, 7:59:56 AM6/21/11
to Tasker
I use this command via locale to delete old backups. I don't know why
it differs from Richard's suggestion, but thought I'd post as an
alternative!

@! find /mnt/sdcard/clockworkmod/backup -mtime +1 -exec rm -rf {} \;

Murz

unread,
Jun 22, 2011, 12:41:17 PM6/22/11
to Tasker
Thanks for the info about locale execute plugin! I wasn't think that
it is compartible with tasker.
So, now I solve my problem. Will be good to see execute action in
Tasker core. Or maybe it already here?

Tune find parameters you can via this site: http://find.unixpin.com/

Pent

unread,
Jun 22, 2011, 5:36:53 PM6/22/11
to Tasker
> Tasker core. Or maybe it already here?

No, not yet.

Pent
Reply all
Reply to author
Forward
0 new messages