sh: date: not found


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting sh: date: not found
# 1  
Old 06-06-2006
sh: date: not found

hi,
i have a cronjob sending output to:
test.log_`date +\%Y\%m\%d\%H\%M`

however, output generated out is test.log_ (without the date & time in the log filename)

it works correctly for the 1st few months, but become as such now. Smilie
i couldn't figure out what's wrong.

any feedback & assistance is appreciated.
Thanks in advanced.
# 2  
Old 06-06-2006
Something changed and now the date command is not in the path. Try giving full location of date command (use "which date" to find it), e.g.

Code:
test.log_`/usr/bin/date +\%Y\%m\%d\%H\%M`

# 3  
Old 06-14-2006
Thank a lot, thestevew.
it works. Smilie
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Answers to Frequently Asked Questions

Compare date in .txt with system date and remove if it's lesser than system date

I m working on shell scripting and I m stuck where in my .txt file there is column as expiry date and I need to compare that date with system date and need to remove all the rows where expiry date is less than system date and create a new .txt with update. (1 Reply)
Discussion started by: Stuti
1 Replies

2. UNIX for Beginners Questions & Answers

Compare date in .txt with system date and remove if it's lesser than system date

Can someone help me with the code wherein there is a file f1.txt with different column and 34 column have expiry date and I need to get that and compare with system date and if expiry date is <system date remove those rows and other rows should be moved to new file f2.txt . I don't want to delete... (2 Replies)
Discussion started by: Stuti
2 Replies

3. Shell Programming and Scripting

Date: invalid date trying to set Linux date in specific format

i try to set linux date & time in specific format but it keep giving me error Example : date "+%d-%m-%C%y %H:%M:%S" -d "19-01-2017 00:05:01" or date +"%d-%m-%C%y %H:%M:%S" -d "19-01-2017 00:05:01" keep giving me this error : date: invalid date ‘19-01-2017 00:05:01' Please use CODE tags... (7 Replies)
Discussion started by: umen
7 Replies

4. Shell Programming and Scripting

Converting a date to friday date and finding Min/Max date

Dear all, I have 2 questions. I have a file with many rows which has date of the format YYYYMMDD. 1. I need to change the date to that weeks friday date(Ex: 20120716(monday) to 20120720). Satuday/Sunday has to be changed to next week friday date too. 2. After converting the date to... (10 Replies)
Discussion started by: 2001.arun
10 Replies

5. Programming

curses.h not found , gtk/gtk.h not found

i have downloaded <libncurses5-dev_5.7+20101128-1_i386.deb> and <ndk++-0.0.1alpha4.tar.bz2> which contains the header files curses.h and gtk/gtk.h .. i have also included them using .. #include "/home/ball/Desktop/Sudoku/project/libncurses5-dev_5.7+20101128-1_i386/usr/include/curses.h" ... (2 Replies)
Discussion started by: upvan111
2 Replies

6. Shell Programming and Scripting

Date One Week Ago From Given Date, Not From Current Date

Hi all, I've used various scripts in the past to work out the date last week from the current date, however I now have a need to work out the date 1 week from a given date. So for example, if I have a date of the 23rd July 2010, I would like a script that can work out that one week back was... (4 Replies)
Discussion started by: Donkey25
4 Replies

7. Shell Programming and Scripting

Log File - Getting Info about preceding Date of Pattern Found

Ok Suppose I have a log file like the below: 2010-07-15 00:00:01,410 DEBUG 2010-07-15 00:01:01,410 DEBUG 2010-07-15 00:01:02,410 DEBUG com.af ajfajfaf affafadfadfd dfa fdfadfdfadfadf fafafdfadfdafadfdaffdaffadf afdfdafdfdafafd error error failure afdfadfdfdfdf EBUDGG eafaferror failure... (6 Replies)
Discussion started by: SkySmart
6 Replies

8. UNIX for Dummies Questions & Answers

Clarification on '1 days ago' in date command [Found answer, posted within]

I know the topic of getting yesterday's date has been covered ad nauseum, but I just want to be clear on something. I recently started using the command date --date='1 days ago' '+%m/%d/%y' to get yesterday's date and it's been working great. I just want to be certain that it is going to... (1 Reply)
Discussion started by: DeCoTwc
1 Replies

9. Shell Programming and Scripting

grep to show date/time of file the string was found in.

I've seen several examples of grep showing the filename the string was found in, but what I really need is grep to show the file details in long format (like ls -l would). scenario is: grep mobile_number todays_files This will show me the string I'm after & which files they turn up in, but... (2 Replies)
Discussion started by: woodstock
2 Replies

10. Shell Programming and Scripting

how can i check in csh if command found or not found ?

hello all im trying to use in sun Solaris the information received from the top command now i several machines that dont have install the top program so when im running the script im geting error saying after im running this code : set MemoryInfo = `top | grep Memory` if (... (2 Replies)
Discussion started by: umen
2 Replies
Login or Register to Ask a Question