Problem with scheduling a shell script on cygwin using cron


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Problem with scheduling a shell script on cygwin using cron
# 1  
Old 08-07-2007
Problem with scheduling a shell script on cygwin using cron

Hi,

Before I start, I would like to inform that, I went through all FAQs and other threads before posting here.

I 'm trying to schedule a shell script on cygwin using cron. No matter what I do I don't seem to get the cron job executing my bash script.

My script is temp.sh

echo `date` > /home/test/temp.log

crontab -e is having the following details

* * * * * sh /home/test/temp.sh > /home/test/temp.sh.err 2>&1

I did use the paths in the script itself and I also used the windows path where the cygwin installed(/cygdrive/d/cygwin/).

What am I doing wrong? Please help.

Thanks
Shash
# 2  
Old 08-08-2007
This happens if you not executing the cron job under root. Only root executes the CRON jobs mentioned under crontab. To execute your own script for testing, just create your own user ID under cron directory(Crontab). Then, write a fresh crontab -e script and execute it manually.

Else, you need to put this command under the crontab file, which executes automatically by root. Also, check if you are getting any error message in the *.err file.

Thanks,
Rohit..
# 3  
Old 08-08-2007
Thanks for the reply Rohit.

I have already have the user created under the direcory
/var/cron/tabs

-rw-r----- 1 test Administrators 292 Aug 8 10:25 test

I am not able to get any .err files.
# 4  
Old 08-09-2007
I have not seen a cron entry like this before.
Quote:
Originally Posted by shash

* * * * * sh /home/test/temp.sh > /home/test/temp.sh.err 2>&1
Is the sh to execute the shell? If so could it be added as the first line of the temp.sh ?
# 5  
Old 08-09-2007
I would start by running it as root if possible. Have you tried it as root? If it works as root and not as your other id it is obviously a permissions issue, or the cron daemon is not running.


Quote:
Originally Posted by shash
Thanks for the reply Rohit.

I have already have the user created under the direcory
/var/cron/tabs

-rw-r----- 1 test Administrators 292 Aug 8 10:25 test

I am not able to get any .err files.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Execution problem with Cron: Script works manually but not w/Cron. Why?

Hello gurus, I am making what I think is a simple db2 call from within a shell script but I am having difficulty producing the desired report when I run the script shown below from a shell script in cron. For example, my script and the crontab file setup is shown below: #!/bin/ksh db2... (3 Replies)
Discussion started by: okonita
3 Replies

2. Shell Programming and Scripting

Error while scheduling the shell script

I am getting the below error while scheduling the job.Why? 00 30 * * * /arbor/integ_fx/rahul_raj/itsr_5652_v2/it.sh /arbor/integ_fx/rahul_raj/itsr_5652_v2 "/tmp/crontabBvaWiv" 47 lines, 2412 characters 00 30 * * * /arbor/integ_fx/rahul_raj/itsr_5652_v2/it.sh ... (2 Replies)
Discussion started by: rafa_fed2
2 Replies

3. Shell Programming and Scripting

Shell script scheduling in cronjob

Hi, I have developed a file deletion script and scheduled it in cronjob to run daily at 5:00 AM. But the script is not running automatically any day. However when I run the script manually at any time, it runs successfully. This is how the cron looks like : 0 5 * * *... (5 Replies)
Discussion started by: jhilmil
5 Replies

4. UNIX for Dummies Questions & Answers

Cron confusion - scheduling a script

I have a script that backs up a directory, creates a log file and mails the log file to us. find . -print | backup -ivqf/dev/rmt0 | tee backup.log cat backup.log|mail -v -s "Tape backup log" maillist This script works fine from the console. When I schedule it in cron, I never get the... (1 Reply)
Discussion started by: landog
1 Replies

5. Shell Programming and Scripting

Problem with executing a shell script through the cron

Hi, I have a shell script as below: ORACLE_HOME=/usr/local/opt/oracle/product/dev export ORACLE_HOME PATH=$PATH:$ORACLE_HOME/bin:/usr/bin export PATH OUTFILE=/export/home/`basename $0`.out export OUTFILE export IDEN df -k . | tail -1 | read a b c d e f echo $a >> $OUTFILE echo $b... (4 Replies)
Discussion started by: Abhinav Pandey
4 Replies

6. Shell Programming and Scripting

Scheduling Cron job-Problem

Hello All, I want to run a script for every 5 minutes interval.So i developed a script which has to be scheduled to run for every 5 minutes. That script internally runs another script. But the problem is it is not executing properly. Can anybody throw some light on this. Below are the code... (4 Replies)
Discussion started by: RSC1985
4 Replies

7. HP-UX

cron scheduling?

Hi all, i want a job to run first monday of every of month. (1 Reply)
Discussion started by: megh
1 Replies

8. Shell Programming and Scripting

Shell script for scheduling

Hi guys, I am new guy for unix. I need help writing the following shell script. My requirement is: I have few pl/sql procedures(lets say 10). I want to run some of them (say 5) parallally in the background and once these are completed trigger the next ones one after other. Could some one... (13 Replies)
Discussion started by: chanduhyd4u
13 Replies

9. Solaris

Passing arguments to a shell script from file while scheduling in cron

Hi, I have a shell script Scp_1.sh for which I have to pass 2 arguments to run. I have another script Scp_2.sh which in turns calls script Scp_1.sh inside. How do I make Scp_1.sh script to read arguments automatically from a file, while running Scp_2.sh? -- Weblogic Support (4 Replies)
Discussion started by: weblogicsupport
4 Replies

10. UNIX for Dummies Questions & Answers

scheduling tasks with cron

hello there, i'm learning about task scheduling with cron and all seems hyper exciting, yeppie. But there is a prob: assume i have a script that needed to be executed at 7am everyday. I could do: vi mycron 00 7 * * * echo hi mother, i wanna be a script daddy. :wq crontab mycron how... (4 Replies)
Discussion started by: alikun
4 Replies
Login or Register to Ask a Question