10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
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
2. Shell Programming and Scripting
Hi,
I have multiple files that read:
Asa.txt
Bad.txt
Gnu.txt
And I want to rename them using awk to
Asa_ddmmyytt.txt and so on
...
If there is a single command or more efficient executable please share!
Thanks! (4 Replies)
Discussion started by: Jesshelle David
4 Replies
3. Red Hat
Hello, can someone please suggest how to create an logrotate for this scenario. Need to delete all log file which are created more than 30 days ago, and all the log file have date stamp on it.
I dont want to create a cron job for this task.
here is the example
-rw-r--r-- 1 tomcat tomcat ... (2 Replies)
Discussion started by: bobby320
2 Replies
4. Shell Programming and Scripting
Hi!
Please see our current script:
#!/usr/bin/ksh
if (egrep "This string is found in the log" /a01/bpm.log)
then
mailx -s "Error from log" me@email.com, him@email.com </a01/bpm.log
fi
To the above existing script, we need to add the following change:
1) After finding the string,... (7 Replies)
Discussion started by: atechcorp
7 Replies
5. Shell Programming and Scripting
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)
Discussion started by: prvnrk
2 Replies
6. Shell Programming and Scripting
I need some help recovering from a "slight" screwup. We just moved 3 TB of data from one RAID Array to another. Low lever archive files. This was done with a regular cp (for some reason) and now we have lost all the timestamps on the files, and we urgently need to get the timestamps back on these... (7 Replies)
Discussion started by: chj
7 Replies
7. UNIX for Dummies Questions & Answers
Hi,
I need to zip the list of files using from date Stamp to end date Stamp, How can I filter and make FromDate_EndDate.gzip?
any idea? (1 Reply)
Discussion started by: redlotus72
1 Replies
8. Shell Programming and Scripting
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)
Discussion started by: lweegp
14 Replies
9. Shell Programming and Scripting
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)
Discussion started by: mgirinath
2 Replies
10. UNIX for Dummies Questions & Answers
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)
Discussion started by: Xenon
1 Replies