• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Tasker not running shell command

Vernon27

Member
Hello Group,

Can someone tell me why the following Shell Command is not working in Tasker:

find /BeyondPod/Podcasts/* -print0 | xargs -0 rm -rv

The above is the equivalent to the following DOS commands:

cd \BeyondPod\Podcasts
forfiles /S /M *.m* /C "cmd /c del @file"

The command supposed to navigate to the cd \BeyondPod\Podcasts directory and delete the contents of each file in the Podcast subdirectory. This will leave the

Podcasts subdirectories empty while not deleting the subdirectories. I am enclosing a description of the Profile along with a screen shot.


Profile: BeyondPod Podcasts Deletions (126)
Day: Sat
Time: From 11:00PM Till 11:10PM
Enter: BeyondPod Subcriptions Download Deletions (127)
<List directories in the BeyondPod/Podcasts directories>
A1: List Files [ Dir:BeyondPod/Podcasts Match:*.* Include Hidden Files:Off Use Root:Off Variable:%beyondfiles ]
<Delete files in the BeyondPod/Podcasts directories>
A2: Run Shell [ Command:find /BeyondPod/Podcasts/* -print0 | xargs -0 rm -r Timeout (Seconds):30 Use Root:Off Store Output In: Store Errors In: Store Result In: ]

Thanks for your help.

Vernon
 

Attachments

  • index.jpg
    index.jpg
    6.9 KB · Views: 494
Maybe try your command in a terminal emulator. This one is free and open source. If it doesn't work there, then you know it's nothing to do with tasker...instead it would be something like syntax error or lack of permission to the directory. The emulator should give an error message to help explain why the command is failing. (Is tasker giving an error message?)
 
Hello electricpete,

I found out the issue. Thanks for your help. I have created a file with a .sh file extension that runs the UNIX commands. Now I have to get Tasker to run that file from a shell command.

Vernon
 
For some reason I cannot figure out why Tasker has problems with such a simple task. The shell command that I can type directly into Linux from the terminal window works but when I try to automate this process in Tasker it does not work.
 
I tried it on un-root-ed Droid Turbo (5.1) and Turbo 2(5.1.1) and using Terminal Emulator and it claimed it could not Find was not found.

... Thom
 
Back
Top Bottom