[APP][TOOL][AUTOMATION] Cron Phone Your Phone[UPDATE (9/28/11)]!!

Search This thread

ASimmons

Retired Recognized Developer
May 4, 2010
1,003
112
Tampa Bay
Major Changes to the UI and usage Check the market for the latest version or use the version attached to this post. If you have trouble with the posted version use the market version as it will always have the lastest fixes. The attached version might have an issue I did update the attached version but I won't manage it here.

1. Complete task ui revamp, easier building and management of tasks.
2. Added cron string builder, you can now build time string with rolling pickers and show you the next execution date (great for visualizing your time string). This will build 98% of the schedules most of us use.

3. Clicking on the clock in the Cron tab will now show all the active queued tasks (tasks that were active when cron was started).

4. Added option to run on boot for a task, this makes tasks execute if the option is checked and cron is set to auto restart. This allows a task to run only, at boot, and the task does not have to be active. (Sascha Kerkeling).
5. Added option to import scripts, you can now import the contents of a script file (Sascha Kerkeling).
6. You can now activate/deactivate a task from the tasks view.

7. I have kept the old tasks view in place for this update so that you can trasnfer any existing tasks over... it will be removed next update.

8. Added cron change log... this will automatically show once every update.
9. Added safe guard so that a reboot command cannot be fired with the execute on boot option (just in case).

10. Added better logging of why task commands fail, this will show as a complete stack trace in the execution log.

11. Added 6 new default tasks that might be helpful (Sascha Kerkeling, A. Simmons).

This is cron for your phone a small app I developed to allow me to restart/shutdown my phone on a schedule, but Cron has a billion uses and I wanted to see how others will use it I also use it to backup my market apps on a schedule.

**WARNING YOUR PHONE NEEDS TO BE ROOTED TO USES THIS APP**
This app can be dangerous if used wrong, if you use this app incorrectly and mess your phone up its your fault not mine. You wouldn't blame snap-on if the wrench you used breaks a bolt on your car, so don't try and blame me for what you do wrong with this tool. If you do I will only point at you and laugh.
**WARNING YOUR PHONE NEEDS TO BE ROOTED TO USES THIS APP**

Features:
Uses the standard Cron4Phone time string schedule.
Run all type of shell commands on any schedule you can think of.
Run tasks to shut your phone off on a schedule.
Auto restart so Cron4Phone continues to run even after a restart.
Small apk foot print.
unlimited concurrent tasks available.
Set a task as inactive/active.
Test execution setting to log commands only.


I'm really looking forward to seeing how others will use this tool. Please feel free to point out errors or suggestions. If you want help setting schedule I can give pointers.

Android market download
 

Attachments

  • ss-480-0-7.jpg
    ss-480-0-7.jpg
    21.5 KB · Views: 1,147
  • ss-480-1-8.jpg
    ss-480-1-8.jpg
    47.2 KB · Views: 1,133
  • ss-480-2-8.jpg
    ss-480-2-8.jpg
    33.7 KB · Views: 1,010
  • ss-480-3-0.jpg
    ss-480-3-0.jpg
    34.3 KB · Views: 988
  • cron4phone.apk
    169.2 KB · Views: 532
Last edited:

ASimmons

Retired Recognized Developer
May 4, 2010
1,003
112
Tampa Bay
Here you go

Here's a copy... I haven't opened the source up although I probably will in the future, when I have more time to spend on it (working on a video game). This copy is signed with the same key as the market version and its ad supported I will slowing be updating the task management part of the ui.

this is the market description

*****YOUR PHONE NEEDS TO BE ROOTED TO USES THIS APP*****
This app can be dangerous if used wrong, if you use this app incorrectly and mess your phone up its your fault not mine. You wouldn't blame snap-on if the wrench you used breaks a bolt on your car, so don't try and blame me for what you do wrong with this tool. If you do I will only point at you and laugh.
*****YOUR PHONE NEEDS TO BE ROOTED TO USES THIS APP*****

-----------NEW INFO READ------------
After another full audit and help from Sascha Kerkeling and M. Porter, I redesigned Cron to no longer use long running service and instead now (correctly) uses AlarmManager to precisely execute tasks in a WakefullIntentService. This will will insure that all task are executed even when the phone is in deep sleep (even when the phoen doesn't hold any other wake locks) and barely uses any resources to accomplish this. I will now be able to focus on the UI... Dynamic task here we come!
-----------NEW INFO READ------------

Cron4Phone is a time-based job scheduler in Unix-like computer operating systems. Cron4Phone enables users to schedule jobs (commands or shell scripts) to run periodically at certain times or dates. It is commonly used to automate system maintenance or administration, though its general-purpose nature means that it can be used for other purposes, such as connecting to the restart your phone and backing up apps. This is a foreground service so that it is guaranteed to stay running, use the home key to back out of the app or double tap the back arrow to kill the app. Killing the app kills the service.

Features:
Uses the standard Cron4Phone time string schedule.
Run all type of shell commands on any schedule you can think of.
Run tasks to shut your phone off on a schedule.
Auto restart so Cron4Phone continues to run even after a restart.
Small apk foot print.
5 concurrent tasks available.
Set a task as inactive/active.
Test execution setting to log commands only.

This tool can be used to do endless amount of things, I'm really looking forward to see what you guys can use it for so please share your ideas, command and schedules.

I have provided 3 tasks that I thought would be the most useful to most users shutdown, restart, and backup apps.
 
Last edited:

ASimmons

Retired Recognized Developer
May 4, 2010
1,003
112
Tampa Bay
New version

EDIT: removed refer to the OP...

I attaching a new version to this post, it fixes a bug with the restart on reboot not registering your tasks. Basically if your phone reboots and you have active tasks and cron is started it will keep on running.

As for the ui I will slowly work on updating the task tab so that task can be managed dynamically, other than that the rest of the ui will basically stay the same, I want it to stay simple and small.

The market version has also been updated.
 
Last edited:

ASimmons

Retired Recognized Developer
May 4, 2010
1,003
112
Tampa Bay
Yes and this was one that I thought was needed, and while you can run cron on your phone through busy box, this app doesn't need that module and uses standard java to mimic cron all while putting a clean ui on top of it.

Thank you.
 

Moon Shadow - NM

Senior Member
Jul 14, 2011
455
502
Albuquerque
[EDIT]
ACK! Okay, I just stopped and started the cron and it is now working. Sorry about this post. :-/
[/EDIT]

I am going to resurrect this thread because I can't figure this out and I'm a Unix admin. I have tried to set a schedule for a job to run every 5 minutes (this was to test, the actual job will run every 30 minutes). I have tried to set */5 * * * *, /5 * * * *, and 0,5 * * * * and none of them work for every 5 minutes. Can you look into this or give an example in here? Thanks!
 
Last edited:

trav06

Senior Member
Apr 25, 2013
129
51
fstrim

If anyone is still out there -- I use Cron4Phone to schedule daily reboots and would like to add an fstrim command to run daily, maybe weekly. Can anyone help me with setting this up (command syntax, etc)?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 5
    Major Changes to the UI and usage Check the market for the latest version or use the version attached to this post. If you have trouble with the posted version use the market version as it will always have the lastest fixes. The attached version might have an issue I did update the attached version but I won't manage it here.

    1. Complete task ui revamp, easier building and management of tasks.
    2. Added cron string builder, you can now build time string with rolling pickers and show you the next execution date (great for visualizing your time string). This will build 98% of the schedules most of us use.

    3. Clicking on the clock in the Cron tab will now show all the active queued tasks (tasks that were active when cron was started).

    4. Added option to run on boot for a task, this makes tasks execute if the option is checked and cron is set to auto restart. This allows a task to run only, at boot, and the task does not have to be active. (Sascha Kerkeling).
    5. Added option to import scripts, you can now import the contents of a script file (Sascha Kerkeling).
    6. You can now activate/deactivate a task from the tasks view.

    7. I have kept the old tasks view in place for this update so that you can trasnfer any existing tasks over... it will be removed next update.

    8. Added cron change log... this will automatically show once every update.
    9. Added safe guard so that a reboot command cannot be fired with the execute on boot option (just in case).

    10. Added better logging of why task commands fail, this will show as a complete stack trace in the execution log.

    11. Added 6 new default tasks that might be helpful (Sascha Kerkeling, A. Simmons).

    This is cron for your phone a small app I developed to allow me to restart/shutdown my phone on a schedule, but Cron has a billion uses and I wanted to see how others will use it I also use it to backup my market apps on a schedule.

    **WARNING YOUR PHONE NEEDS TO BE ROOTED TO USES THIS APP**
    This app can be dangerous if used wrong, if you use this app incorrectly and mess your phone up its your fault not mine. You wouldn't blame snap-on if the wrench you used breaks a bolt on your car, so don't try and blame me for what you do wrong with this tool. If you do I will only point at you and laugh.
    **WARNING YOUR PHONE NEEDS TO BE ROOTED TO USES THIS APP**

    Features:
    Uses the standard Cron4Phone time string schedule.
    Run all type of shell commands on any schedule you can think of.
    Run tasks to shut your phone off on a schedule.
    Auto restart so Cron4Phone continues to run even after a restart.
    Small apk foot print.
    unlimited concurrent tasks available.
    Set a task as inactive/active.
    Test execution setting to log commands only.


    I'm really looking forward to seeing how others will use this tool. Please feel free to point out errors or suggestions. If you want help setting schedule I can give pointers.

    Android market download
    1
    ooooh

    as soon as I can liberate a copy from a market enabled phone I will begin tinkering... that might take a while

    would you consider releasing it to f-droid.org if your license allows? :D
    1
    Interesting

    Sent from my SCH-I500 using XDA App
    1
    testing your application, it's really simple.., i'm hoping custom task can be added more
    1
    Very nice app, I would like to see more Linux tools working with Android.

    Sent from my Zio using xda premium