cron troubles


 
Thread Tools Search this Thread
Operating Systems HP-UX cron troubles
# 1  
Old 02-08-2008
cron troubles

I have a cronjob that I need to run everyday and it needs to have todays date inputed, here is what I have, but is not working as expected..........

23 02 * * * cd /path;./RequestSummaryReport.sh $(date +%Y-%m-%d)

the output from mail gives me.............

Code:
Date: Fri, 8 Feb 2008 02:12:07 -0600 (CST)
From: root@hostname.com
Message-Id: <200802080812.m188C74S025870@hostname.com>
Subject: cron

stty: : Not a typewriter

Please Enter the date for which you want the Daily Summary Report: (YYYY-MM-DD)
You entered:
Y-
is that correct?(y|n)
Buildfile: /path/ARAutoPostJMSClient.xml

run:
    [input] skipping input as property report.request has already been set.
     [java] Retrieving a QueueConnectionFactory from JNDI
     [java] factory created...
     [java] Creating a Connection
     [java] Starting the Connection
     [java] Creating a Session
     [java] Retrieving a Queue from JNDI
     [java] Creating a QueueSender
     [java] Creating a TextMessage
     [java] Adding Text
     [java] -Sending message [<ReportMsg><ReportType>autopostpayment.SummaryReport</ReportType><FileId></FileId><Date>Y-</Date></ReportMsg>] to queue://HDS.P.01/HDS.REQUEST.AR_REPORT.1_0
     [java] Closing QueueSender
     [java] Closing Session
     [java] Closing Connection
     [java] finished

BUILD SUCCESSFUL
Total time: 4 seconds


*************************************************
Cron: The previous message is the standard output
      and standard error of one of your crontab commands:

cd /path;./RequestSummaryReport.sh $(date +

Why is this date format not working correctly? If I manualy run
/path/RequestSummaryReport.sh $(date +%Y-%m-%d) it works fine. ?????

Dave
# 2  
Old 02-08-2008
Dear ,
I don't know why u r passing the date parameter during execution through Variable .
You can define the same in the original script only ,which has to work ..
.pls check .
# 3  
Old 02-08-2008
I was givin this script to put into cron, they will not change the script. The script is written so that you must give it a date. If no date variable is input it will prompt for a date.
Since they would not change the script, I just wrote a quick script that will call the report script with the date variable. Rund fine from cron. I would rather them change the script todefault to todays date, but that is like pulling teeth.

Thanks
Dave
# 4  
Old 02-08-2008
The crontab man page says:
Quote:
A percent character (%) in this field (unless escaped by a backslash (\)) is translated to a newline character, dividing the field into "lines". Only the first "line" (up to a % or end-of-line) of the command field is executed by the shell. Any other "lines" are made available to the command as standard input.
# 5  
Old 02-08-2008
Thanks Perderabo,

I escaped out the % signs with a \ and it runs now as expected, still trying to get the script change to default todays date though.

Dave
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Troubles running DB2 command in shell script via cron

Hi there, Now I'm facing error regarding running shell script via cron. The shell script which is required to get value from database. Below is the main part of shell script. #/bin/bash #connect to database(1) db2 connect to $database user xxxx using yyyy #set values from... (3 Replies)
Discussion started by: Rohan Kishibe
3 Replies

2. UNIX for Advanced & Expert Users

Troubles with OpenSSH

Hi, I am trying to login from one AIX server to another without using a password, a basic configuration, however it doesn't seem to work. All things are in place. I have both a public and private key in the ~/.ssh folder and also have an "authorized_keys" file on the target-server containing... (5 Replies)
Discussion started by: Hille
5 Replies

3. BSD

PF troubles on OpenBSD 5.0

I am setting up a system as an ADSL gateway. ADSL is working fine. PF is not forwarding for some reason. # ifconfig lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 33196 priority: 0 groups: lo inet6... (0 Replies)
Discussion started by: John Tate
0 Replies

4. UNIX for Dummies Questions & Answers

Cron troubles

I am aware this question has been answered time and again. I feel I have tried everything I have seen on the net and really need help to get this working. Same old story. Shell script, working from command but not from cron. I need my script to take values from a .properties file. Tried... (2 Replies)
Discussion started by: airalpha
2 Replies

5. Shell Programming and Scripting

Encoding troubles

Hello All I have a set of files, each one containing some lines that follows that regex: regex='disabled\,.*\,\".*\"'and here is what file says about each files: file <random file> <random file> ASCII text, with CRLF line terminatorsSo, as an example, here is what a file ("Daffy Duck - The... (3 Replies)
Discussion started by: tukuyomi
3 Replies

6. Shell Programming and Scripting

if-statement troubles

I try to compare the day and month of someones birthday with the day and month of today, so my little bash script can send a mail to the person that has its birthday that day. The first line of the file birthdays looks like this: firstname,lastname,01/01/1990,.... The variable birthday's... (4 Replies)
Discussion started by: doc.arne
4 Replies

7. UNIX for Dummies Questions & Answers

ssh2 troubles

I'm trying to set up a secure and trusted connection between 2 boxes running solaris using ssh2. I've run ssh-keygen2 on the local box and on the remote box, created the identification file ( IdKey id_dsa_2048_a ) on the local machine and copied across the public key file from the local to... (5 Replies)
Discussion started by: PaulC
5 Replies

8. UNIX for Dummies Questions & Answers

Password Troubles

I'm very new to UNIX (I just started working with Terminal 2 days ago) and I don't know the system very well. I'm having trouble whenever I am asked for a password. I simply... can't type. I press keys on the keyboard but no characters appear on the screen. For example, when I log onto... (5 Replies)
Discussion started by: alexmiller
5 Replies

9. Programming

Troubles with HPUX

Hello I created an application in c language for HP-UX operative system,and it runs on a 32 bits PARISC processor. My problem is that I have to run this same application but now in a 64 bits Parisc processor. But I am not able to compile the application with the 64 bit server, and I only could use... (1 Reply)
Discussion started by: masterboy6666
1 Replies

10. UNIX Desktop Questions & Answers

NetBSD Troubles

HI, I just installed NetBSD i386 v. latest. I am having a few problems: For some reason X just won't start!? Another is I can't access My CDROM or Floppy. Thanks in advance! (3 Replies)
Discussion started by: vertigo
3 Replies
Login or Register to Ask a Question