• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 250
  • Last Modified:

Schedule task in Linux

I am trying to schedule a task in Linux. and build.sh has a maven clean command. I tried all the combinations but it doesnt invoke the build.sh 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/build.sh
1 Solution
It should be

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


*    *    *    *    *  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)
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.
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.

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Gerwin Jansen, EE MVETopic Advisor Commented:
Call your 'profile' from the build.sh 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...
MeenuNagpalAuthor Commented:
Thanks Every one
My stupidest mistake...file was read-write onle
Glad you found it, but you shouldn't have accepted my comment, because it doesn't contain the solution!


Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now