Schedule task in Linux

Posted on 2011-05-09
Last Modified: 2012-05-11
I am trying to schedule a task in Linux. and has a maven clean command. I tried all the combinations but it doesnt invoke the execution.
Tried following to execute every 2 minute. But didnt it didn't clean the project.

 2 * * * /home/administrator/Desktop/development/eclipse/com.radsdk.framework/
Question by:MeenuNagpal
    LVL 58

    Expert Comment

    It should be

    */2 * * * * /home/administrator/Desktop/development/eclipse/com.radsdk.framework/

    *    *    *    *    *  command to be executed
    -    -    -    -    -
    |    |    |    |    |
    |    |    |    |    |
    |    |    |    |    +----- day of week (0 - 7) (Sunday=0 or 7)
    |    |    |    +---------- month (1 - 12)
    |    |    +--------------- day of month (1 - 31)
    |    +-------------------- hour (0 - 23)
    +------------------------- min (0 - 59)
    LVL 40

    Expert Comment

    Check your script to ensure that it doesn't make assumptions to home directory (or that it sets its working directory).

    Check the mail of the owner to see if cron sent any error messages.
    LVL 68

    Accepted Solution

    Yiur job will only execute 2 minutes past the hour, not every two minutes.
    Use "*/2" instead of "2" alone.
    Also take care to always use full paths wit every command inside the script, and pleasenote that there's not the full environment under cron, because .profile is not executed.

    LVL 37

    Expert Comment

    by:Gerwin Jansen
    Call your 'profile' from the script to set all variables and path needed by the ANT build script. Second, make sure that your build finishes within 2 minutes or you system will become quite slow...

    Author Comment

    Thanks Every one
    My stupidest mistake...file was read-write onle
    LVL 68

    Expert Comment

    Glad you found it, but you shouldn't have accepted my comment, because it doesn't contain the solution!


    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    If you have a server on collocation with the super-fast CPU, that doesn't mean that you get it running at full power. Here is a preamble. When doing inventory of Linux servers, that I'm administering, I've found that some of them are running on l…
    Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
    Video by: Michael
    Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
    This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

    746 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now