I am trying to execute a script (for once) during the booting time in Ubuntu system. However, the result is only showing the strings without without the variables.
Here is the script:
The result in the output file (myLog) is the following:
The result should be:
But,when I execute the script manually by invoking the command:
./myScript.sh
it executes perfectly and providing me all the correct outputs (the strings and the variables).
the crontab entry is the following:
@reboot /home/ubuntu/myScript.sh
Also, the permission on the myScript.sh is 777
Am not sure if this is the only way to execute script for once after the booting time.
Thank you in advance
Last edited by Corona688; 09-20-2012 at 07:31 PM..
777 is not the magic sledgehammer to fix all permissions problems. 750 ought to do.
You probably don't have that application in your PATH, so it can't run anything, leaving the variable blank. . /etc/profile at the top of your script perhaps to make sure it loads a complete one.
I have set several cron jobs. I recently added a new cron job that copies a file of last day from another server and is executed each day (for example at 04:00 am) but when I check next day the file hasn't been copied.
I'm working in GNU/Linux CentOS (2.6.32) system.
The files that I need to... (23 Replies)
Dear *nix users.
I'm on Mac OS 10.6 / Terminal and try to use crontab to schedule two scripts every 30 minutes and every 41 minutes.
I followed the man instructions and created / installed a crontab file for the current user:crontab -e
with the following content
*/30 * * * *... (4 Replies)
The .profile file should be read when the user logs in. So, there should be no need to execute .profile file again in a cron job (since the cron job is run after the user logs in). Doesn't the cron require login from the user. Then, from where does the cron execute? Please help!! (1 Reply)
Hi all,
I really need your help ASAP on this. Below is the description of my problem and a sketch of Autosys
Job Activity Console
++++++++++++++++++++++++++++++++
File View Options
+++++++++++++++++++++++++++++++
Job Name Description Status Command Machine... (1 Reply)
I have got a file job_tree.lst , which contains 1 line as below
$ cat job_tree.lst
ABC_D_EQ_XXXXX_YYYY_PRD_UX 05/08/2009 05:47 05/08/2009 05:50 IN 13412850/0
I want to get a child job string 3 characters offset from the parent job string (i.e. ABC_D_EQ_XXXXX_YYYY_PRD_UX 05/08/2009... (4 Replies)
I wrote a script to shutdown the oracle database. The script works fine when I manually run the script. However, when i schedule a job, i get the following error.
Shutting Down cmismart ....................
ORA-01034: ORACLE not available
ORA-27101: shared memory realm does not exist
SVR4... (6 Replies)
I have a script running in the crontab that gets data from a database every hour. Now I would like to execute a fortran routine to process the data in some way, after getting it and saving it locally.
I have added the following commands to my script:
set convert =... (1 Reply)
hi guys,
i have a problem.
a week ago i made a successful crontab that execute bash scripting daily, it worked well
but now, it doesn't work at all, in the mail i have:
"
/home/jimmy/cha/scripts/cekpderr
produced the following output:
lagi jalan
/home/jimmy/cha/scripts/cekpderr:... (6 Replies)
I have the following crontab entry to run a shell script for every 30 minutes of every day:
30 * * * * $HOME/main.sh > $HOME/main.log 2>$HOME/error.log
after I created the crontab file I have also done:
$crontab my_crontab
I also check to make sure it exists, by using the following... (11 Replies)
i have a script that uses an ant build.xml and its targets to pull a project from a cvs server, attempt to build the project, and then email me the results. When I run the script (either @ CLI or as a cron job) while I am logged in, everything works fine. However, if the script is set up to run... (5 Replies)