LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
LinkBack Search this Thread
Old 01-05-2005, 05:46 PM   #1
SheldonPlankton
Member
 
Registered: Jun 2004
Posts: 129

Rep: Reputation: 15
why do these cronjob not run?


Hi,

I use to be able to do stuff like this with Solaris is there some reason why these lines in my crontab don't work with RH9?
Code:
# blah blah
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=dog
MYts=`date +%Y%m%d%H%M`

# these do NOT run
* * * * * export MYts="XYZ" ;; echo $MYts > test_file_1
* * * * * MYts=`date` ;; export MYts ;; echo $MYts > test_file_2
* * * * * MYts=`date` ;; echo $MYts > test_file_2a
* * * * * echo "Hello" > test_file_`date +%H%M`

# this does run
* * * * * date > test_file_3
 
Old 01-05-2005, 08:01 PM   #2
jailbait
Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Squeeze, Fedora 14
Posts: 7,268

Rep: Reputation: 83
export MYts="XYZ" ;; echo $MYts > test_file_1
should work OK.


Try picking up the date this way:
MYts=$(date)

Try changing:
echo "Hello" > test_file_`date +%H%M`
to:
echo "Hello" > test_file_$(date +'%H%M')


-----------------------------
Steve Stites
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
cronjob help meeh Linux - General 1 03-26-2004 11:41 AM
Cronjob engnet Linux - Networking 6 03-03-2004 09:21 AM
cronjob ugob Linux - Software 0 03-03-2004 09:20 AM
Su in a cronjob michedlp Programming 3 11-06-2003 08:30 AM
cronjob FastEddy Linux - General 1 04-12-2003 09:52 PM


All times are GMT -5. The time now is 12:00 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration