cron a script and output to file named with date stamp
I can do this from the command line:
It yields a file named: 20110429log.csv
I would like to schedule with cron to run daily.
when I enter the same line, as above in cron:
...it trucates at the first percent sign and yields a cron error:
unexpected EOF while looking for matching ``'
...cron executes:
/home/mylogin/tests/script.sh > /home/mylogin/tests/`date +"
It was suggested that I escape the percent sign:
However, that doesn't seem to execute at all. I get no ouitput file and no sign of a cron error.
Any insight would be greatly appreciated.
Thanks,
-dog
Last edited by Yogesh Sawant; 05-01-2011 at 07:10 AM..
Reason: added code tags
I have to capture the creation date and time stamp for a file. The ls command doesn't list all the required information. I need year, month, day, hour, minute and second.
Any ideas... (1 Reply)
Hi,
can any one tell me how to achieve this...I will input the path and file name and it should rename it to current date and time...
this is what I tried...
#! /usr/bin/sh
set -x
cd /info_stg/vul/Scripts
TODAY_DATE_TIME=`date +%Y%m%d%H%M%S`
IN_FILE_PATH=`cat file.txt | awk -F, '{... (2 Replies)
Dear Gurus,
I'm trying to move a number of files from one directory to another directory with a new date stamp. This is my script:
#! /bin/csh
Today_Date=`date +%Y%M%D`
mv /usr/TRS/data/TS* /usr/TRS/backup/TS*.${Today_Date}
when i run the script i'm getting the following errors:
mv:... (14 Replies)
I have searched several thread and not found my solution, so I am posting a new qustion.
I have a very simple script on an AIX server that FTPs 2 files to a MS FTP server. These 2 files are created on the AIX server every hour, with a static name.
I need to FTP the files to the MS server, but... (1 Reply)
Hi
I use "touch -t xxxxxxxx" command to set date/time stamp of a file. My requirement is to read the date/time stamp of a file and apply it to another file.
Is there anyway to do it simple instead of manually taking date/stamp of first file?
TIA
Prvn (2 Replies)
I would like to pipe (redirect ? - what is the right term?) the output of my script to a file named with the current date.
If I run this at a command prompt:
date +'%Y%m%d"
...it returns "20110429"
OK, that's good... so I try:
./script.sh > "'date +%Y%m%d'.csv"
I get a file... (1 Reply)
Help with Perl script :
I have a web.xml file with a line
<display-name>some_text_here</display-name>
Need to append the current date and time stamp to the string and save the XML file
Something like
<display-name>some_text_here._01_23_2014_03_56_33</display-name>
-->Finally want... (5 Replies)
I am developing one script which will take log file name, output file name, date, hour and minute as an argument and based on these inputs, the script will scan and capture all the error(s) that have been triggered from a given time. Example: script should capture all the error after 13:50 on Jan... (2 Replies)
trying to add a date stamp to the name of a file with sed. can't seem to comment out the date command so that sed does not only see it as a literal text string
this is what I'm trying
ls file.txt | sed 's/file.txt/file\/`date`\/.txt/g'but it's giving this
file/`date`/.txtlooking for something... (1 Reply)
Discussion started by: jimmyf
1 Replies
LEARN ABOUT SUNOS
amt
amt(1) User Commands amt(1)NAME
amt - run abstract machine test
SYNOPSIS
amt [-s]
DESCRIPTION
The amt command is for use in a Common Criteria security certified system. The command is used to verify that the low level functions nec-
essary to enforce the object reuse requirements of the Controlled Access Protection Profile are working correctly. /usr/bin/amt is a shell
script that executes tests specific to your system. For a 32-bit system, the tests run as a 32-bit application. For a 64-bit system, the
tests run twice; once as a 32-bit application and once as a 64-bit application.
amt lists test results with a "pass" or "fail" for each test it performs, unless output is suppressed with the -s option.
OPTIONS
The following option is supported:
-s Suppresses output.
EXIT STATUS
The following error values are returned:
0 All tests passed.
>0 Count of the number of tests that failed.
<0 Incorrect command line argument.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
|Interface Stability |Evolving |
+-----------------------------+-----------------------------+
SEE ALSO attributes(5)SunOS 5.10 19 Aug 2003 amt(1)