• 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
0
MeenuNagpal
Asked:
MeenuNagpal
1 Solution
 
amit_gCommented:
It should be

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

http://en.wikipedia.org/wiki/Cron

*    *    *    *    *  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)
0
 
mrjoltcolaCommented:
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.
0
 
woolmilkporcCommented:
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.

wmp
0
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...
0
 
MeenuNagpalAuthor Commented:
Thanks Every one
My stupidest mistake...file was read-write onle
:)
0
 
woolmilkporcCommented:
Glad you found it, but you shouldn't have accepted my comment, because it doesn't contain the solution!

wmp
0

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