I have a shell script which will run project consist of multiple JUnit tests.  Then I call this shell within cron job every a period of time. In this case, I observe the following:   Time to complete executing this shell is longer than directly calling this shell.   I don't know why!?  They must have the same run time, mustn't they?
124296
I have an rsync cron job which is pushing the server load and triggering monitor alerts.  If I set the job to be run with a high nice level, would that effectively reduce the impact it has on system load values?
118991
I am running jmeter by launching the .sh script, once I do that I cannot start using the prompt again unless I ctrl-z, ctrl-c, or the script ends in some other way.  How can I launch that script and still be able to use the same console after the script is launched.  (i used to know how to do this, it's easy =()  I guess another way of putting it is how do I launch the script independently of the terminal.
109915
I have a CRONTAB entry as below. Can someone tell me what the below statement is exactly doing?  1 0 * * * /vol01/sites/provisioning/MNMS/45627/45627.sh1 &gt;&gt; /vol01/sites/provisioning/MNMS/45627/output/cron.log 2&gt;&amp;1
3220
I am wondering what the point of sh being symbolic linked to dash is? I understand that dash is supposed to be faster than bash, but I am uncertain why the original sh shell isn't present in sh.   Or if anything why isn't sh linked to bash?
5416
It is quite simple to run a Unix command from Java.   Runtime.getRuntime().exec(myCommand);   But is it possible to run a Unix shell script from Java code? If yes, would it be a good practice to run a shell script from within Java code?
14503
If I place a shell script in /etc/cron.daily/, at what time of the day will it be executed?
47297
I have a program that receives an argument and prints it every second:    ~# ./myapp 234 234 234 234 234 ...     I want to be able to run it in the background and right after a shell but it must be in one line (I don't want to explain why I need it because I don't want to make the discussion too complicated right now).    This is what I tried and the error I received:    ~# bash -c "./myapp 234 &amp;; sh"  bash: -c: line 0: syntax error near unexpected token `;' bash: -c: line 0: `./myapp 234 &amp;; sh'   I also tried with &amp;&amp; as separator:    ~# bash -c "./myapp 234 &amp; &amp;&amp; sh"  bash: -c: line 0: syntax error near unexpected token `&amp;&amp;' bash: -c: line 0: `./myapp 234 &amp; &amp;&amp; sh'   Any idea how I can solve it?    EDIT: Thanks to @roaima. I also found a link that talks about it:
36270
Is there a script or a way in linux that when I try to execute a shell script/process, if the same is running, it will prompt that same is running and will exit otherwise it will continue.
17208
I want to have a shell script like this:  my-app &amp; echo $my-app-pid   But I do not know how the get the pid of the just executed command.  I know I can just use the jobs -p my-app command to grep the pid. But if I want to execute the shell multiple times, this method will not work. Because the jobspec is ambiguous.
93422
I tried to set up a root cron job to run a Bash script as root, to run at minute 7,37, every hour, every day of month, every month. This script is located in /usr/bin and named tunlrupdate.sh. It updates the DNS of Tunlr.  $ ls -l /usr/bin/tunlrupdate.sh  -rwxr-xr-x 1 root root 2133 Sep 24 15:42 /usr/bin/tunlrupdate.sh   This Bash script is available .  When invoked the script writes what's happening in a log located in /var/log/tunlr.log  To add this root cron job I used the standard for root's crontab  sudo crontab -e   And inserted these 2 lines at the end. I expect cron to run the script as root.  # check for updated Tunlr DNS every 30 minutes at the hour + 7 mn and hour + 37 mn 07,37 * * * * root /usr/bin/tunlrupdate.sh   A later command sudo crontab -l confirmed that the cron job has been inserted.  I did reboot Ubuntu and was checking in the log file if the cron job was launched properly. However there is nothing in the logfile /var/log/tunlr.log meaning the job was never successfully launched.  I did check that if I run the script from the command line  sudo /usr/bin/tunlrupdate.sh   then the logfile is updated accordingly.  Why is this cron job not running as planned in my system?  UPDATE 1 : All the proposed solutions so far do not work. I thank Olli for a CLI to list the system log sudo grep CRON /var/log/syslog. However I did get a CRON error  CRON[13092]: (root) CMD (  [ -x /usr/lib/php5/maxlifetime ] &amp;&amp; [ -d /var/lib/php5 ] &amp;&amp; find /var/lib/php5/ -depth -mindepth 1 -maxdepth 1 -type f -cmin +$(/usr/lib/php /maxlifetime) ! -execdir fuser -s {} 2&gt;/dev/null \; -delete)   with the suggested PATH= insertion &amp; use of absolute path from root for functions in the script or without this suggested solutions here. I still get this error.  After some searching I pinpointed the error in the file /usr/lib/php5/maxlifetime as is explained : Change #!/bin/sh -e --&gt; #!/bin/sh -x  Then listing the CRON error log in my system  sudo grep CRON /var/log/syslog Feb 11 18:07:01 Marius-PC CRON[14067]: (root) CMD (root /usr/bin/tunlrupdate.sh) Feb 11 18:07:01 Marius-PC CRON[14066]: (root) MAIL (mailed 1 byte of output; but got status 0x00ff, #012)   I still don't get the bash script executing. This time no error is shown in the log. To get assurance this was not the content of the script I reduced the script to the following 3 lines:  #!/bin/bash LOGFILE=/var/log/tunlr.log echo $LOGFILE &gt;&gt; $LOGFILE   I still don't get the cron job through. Nothing is written in the log file. So even may be an empty script will not run in cron ? I don't get it. I am know trying a script reduced to these 2 lines:  #!/bin/bash exit 0   And still the same error log. The cron script does not go through ...
39901
I saw this in the end of an awesome shell script but I can't understand the login here because I think it's being short-handed for a longer command.  spark ${@:-`cat`}   This apears at the end of . Any ideas?  + Marks for some one who extends it into a full segment of code, even if its slower (Better for explanation)
35006
I wrote a bash script that executes a Java jar for a n number of times.  In practice, I defined e foo() function, containing the invocation of the jar, and then I run this script:  for RUN in $(seq 1 $RUNS)  do      foo &amp;  done   Now, I would like to not execute runs times in parallel the jar. There is a wait to limit the number of parallel execution (like a wait every 10 process for instance)?
41942
I have the shell script  CONTROLLER_IP="" if [ "$#" -eq 1 ] then     CONTROLLER_IP=$1 else     echo "Usage : create_endpoint.sh --controller-ip &lt;Controller IP&gt;"     exit 1 fi   but its executing like this ./create_endpoint.sh 10.10.10.1   I want to execute like this /create_endpoint.sh --controller-ip 10.10.10.1
20165
I have written a simple script.  When I runsh &lt;myscriptname.sh&gt;, i got the correct output, but when I run ./&lt;myscriptname.sh&gt;, I got an error.  What is difference between when I do sh and ./?
6379
I want to create a log file for a cron script that has the current hour in the log file name. This is the command I tried to use:  0 * * * * echo hello &gt;&gt; ~/cron-logs/hourly/test`date "+%d"`.log   Unfortunately I get this message when that runs:  /bin/sh: -c: line 0: unexpected EOF while looking for matching ``' /bin/sh: -c: line 1: syntax error: unexpected end of file   I have tried escaping the date part in various ways, but without much luck. Is it possible to make this happen in-line in a crontab file or do I need to create a shell script to do this?
104056
I'm trying some things with my shell. This includes the following command:  kill $$  My expectation was that the shell would log me out and terminate itself. But instead the bash persists without change.   Any idea why?  I ran this command on different environments (archlinux, debian). The behavior was always the same.
115679
Am I correct to assume that when ; joins two commands on a line, Bash always waits until the first command has exited before executing the second command? And similarly, in a shell script containing two different commands on different lines, Bash always waits until the command on the first line has exited before executing the command on the second line?  If this is the case, is there a way to execute two commands in one line or in a script, so that the second command doesn't wait until the first command has finished?  Also, are different lines in a shell script equivalent to separate lines joined by ; or &amp;&amp;?