If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > to run crontab

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-04-04, 17:03
sjumma sjumma is offline
Registered User
 
Join Date: Oct 2003
Posts: 232
Talking to run crontab

here are 2 script file that i need to run through crontab every day at 1 am
file name verscript, ver1script

What should be contained in my crontab file this

0 1 * * * /usr/viis/conf/./verscript
0 1 * * * /usr/viis/conf/./ver1script


or

0 1 * * * ./ usr/viis/conf/verscript
0 1 * * * ./ usr/viis/conf/ver1script
__________________
bigfoots
Reply With Quote
  #2 (permalink)  
Old 11-04-04, 18:00
vgersh99 vgersh99 is offline
Registered User
 
Join Date: Apr 2004
Location: Boston, MA
Posts: 325
doing 'man crontab' yields:

Quote:
crontab Entry Format
A crontab file consists of lines of six fields each. The
fields are separated by spaces or tabs. The first five are
integer patterns that specify the following:


minute (0-59),
hour (0-23),
day of the month (1-31),
month of the year (1-12),
day of the week (0-6 with 0=Sunday).

Each of these patterns may be either an asterisk (meaning
all legal values) or a list of elements separated by commas.
An element is either a number or two numbers separated by a
minus sign (meaning an inclusive range). Note that the
specification of days may be made by two fields (day of the
month and day of the week). Both are adhered to if specified
as a list of elements. See EXAMPLES.
__________________
vlad
+-----------------------+
| #include <disclaimer.h> |
+-----------------------+
Reply With Quote
  #3 (permalink)  
Old 11-05-04, 08:51
LKBrwn_DBA LKBrwn_DBA is offline
Registered User
 
Join Date: Jun 2003
Location: West Palm Beach, FL
Posts: 2,456
Cool

This:
Code:
0 1 * * * /usr/viis/conf/verscript
0 1 * * * /usr/viis/conf/ver1script
__________________
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
Reply With Quote
  #4 (permalink)  
Old 11-05-04, 09:09
sjumma sjumma is offline
Registered User
 
Join Date: Oct 2003
Posts: 232
Arrow

I have tried the above code does not work


i did crontab -e type in the code, do i need to do anything after that
__________________
bigfoots
Reply With Quote
  #5 (permalink)  
Old 11-05-04, 13:49
LKBrwn_DBA LKBrwn_DBA is offline
Registered User
 
Join Date: Jun 2003
Location: West Palm Beach, FL
Posts: 2,456
Cool

Quote:
Originally Posted by sjumma
I have tried the above code does not work
i did crontab -e type in the code, do i need to do anything after that
1) Are your scripts executable (chmod +x ver*)?
2) Are you setting the environment variables (like with .profile)?
3) Try executing like this:
Code:
0 1 * * * /usr/viis/conf/verscript >/tmp/verscript.log
0 1 * * * /usr/viis/conf/ver1script >/tmp/ver1script.log
...and check out what the /tmp/ver*.logs say.

__________________
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
Reply With Quote
  #6 (permalink)  
Old 11-05-04, 16:48
sjumma sjumma is offline
Registered User
 
Join Date: Oct 2003
Posts: 232
Arrow

i have given chmod 777 to both verscript and ver1script

both are ksh script which outputs a ver1copy.bat and vercopy.bat

they are in /usr/viis/conf


but still does not run
__________________
bigfoots
Reply With Quote
  #7 (permalink)  
Old 11-08-04, 08:51
LKBrwn_DBA LKBrwn_DBA is offline
Registered User
 
Join Date: Jun 2003
Location: West Palm Beach, FL
Posts: 2,456
Question

Quote:
Originally Posted by sjumma
i have given chmod 777 to both verscript and ver1script
both are ksh script which outputs a ver1copy.bat and vercopy.bat
they are in /usr/viis/conf
but still does not run
Did you try the #3 format i suggested?
What is in the /tmp/vercopy.log files?
Do your scripts begin with: #!/bin/ksh ?
What is this '.bat', are you using windows OS?

__________________
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
Reply With Quote
  #8 (permalink)  
Old 11-08-04, 09:58
sjumma sjumma is offline
Registered User
 
Join Date: Oct 2003
Posts: 232
Arrow

Did you try the #3 format i suggested?
I tried your 3 format did not work

What is in the /tmp/vercopy.log files?
I did not see the log file i had forwarded to ie > /usr/viis/conf/test


What is this '.bat', are you using windows OS?
.bat file is the out put of my verscript which i will later from a window machine get it via an ftp


Do your scripts begin with: #!/bin/ksh ?
Yes it does so i tried using
0 1 * * * /bin/ksh /usr/viis/conf/verscript

/bin/ksh for directory where my korn shell is supposed to be


at this moment i thing crontab is not set up fine
__________________
bigfoots
Reply With Quote
  #9 (permalink)  
Old 11-08-04, 09:59
sjumma sjumma is offline
Registered User
 
Join Date: Oct 2003
Posts: 232
Arrow

Did you try the #3 format i suggested?
I tried your 3 format did not work

What is in the /tmp/vercopy.log files?
I did not see the log file i had forwarded to ie > /usr/viis/conf/test


What is this '.bat', are you using windows OS?
.bat file is the out put of my verscript which i will later from a window machine get it via an ftp


Do your scripts begin with: #!/bin/ksh ?
Yes it does so i tried using
0 1 * * * /bin/ksh /usr/viis/conf/verscript

/bin/ksh for directory where my korn shell is supposed to be


at this moment i thing crontab is not set up fine

any help will be appreciated
i tried with
* * * * * echo `date`

did not work either
__________________
bigfoots
Reply With Quote
  #10 (permalink)  
Old 11-08-04, 11:16
TimoV TimoV is offline
Registered User
 
Join Date: Dec 2003
Posts: 56
Quote:
Originally Posted by sjumma
Did you try the #3 format i suggested?
i tried with
* * * * * echo `date`
did not work either
That command isn't going to work cause it has nowhere to output the DATE to. Change it so
* * * * * date > /tmp/date.tmp

Then every minute the /tmp/date.tmp should be refreshed with the current date and time.
Reply With Quote
  #11 (permalink)  
Old 11-08-04, 11:35
sjumma sjumma is offline
Registered User
 
Join Date: Oct 2003
Posts: 232
Got it yes the output has to be a file
i taught it was taking default


Thanks guys aprreciated
__________________
bigfoots
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On