Scripting data, day after


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Scripting data, day after
# 8  
Old 08-21-2009
Code:
temp=`date '+%d'`
temp=`expr $temp - 1`
echo subscriber.log.`date +%Y-%m-`$temp

This should give you the yesterday's file name
# 9  
Old 08-21-2009
is this the first line and than i do grep?
thank mate... im in hell...
# 10  
Old 08-21-2009
Code:
#!/bin/sh.
temp=`date '+%d'`
temp=`expr $temp - 1`
filename='echo subscriber.log.`date +%Y-%m-`$temp'
more $filename| grep Purchase subscriber.log > dacha
ftp -v -n "10.15.20.245" <<cmd
user "fun" "fun"
send dacha
quit
cmd

# 11  
Old 08-21-2009
Im done IT! Thanks a LOT!

---------- Post updated at 02:17 PM ---------- Previous update was at 02:07 PM ----------

Code:
#!/bin/sh.
temp=`date '+%d'`
temp=`expr $temp - 1`
more subscriber.log.`date +%Y-%m-`$temp | grep Purchase subscriber.log.`date +%Y-%m-`$temp > dacha
ftp -v -n "10.15.20.245" <<cmd
user "fun" "fun"
send dacha
quit
cmd


This is a command, when i use for grep just subsciber.log scrip always give me log from today... is is a solution... thanks for backup!!!!
# 12  
Old 08-21-2009
Is this a question? Sorry, I didn't get you
# 13  
Old 08-24-2009
No, i finished this... tnx mate!!!! Very....
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to get the consecutive last 10 week day date using UNIX ksh shell scripting?

Hi, i am writing a ksh shell script to check the last month end date whether it is falling in last 10 week day date, I am not sure How to use "Mr. Perderabo's date calculator", Could you Please let me know how to use to get my requirement, I tried my own script but duplicate week day and... (5 Replies)
Discussion started by: karthikram
5 Replies

2. Shell Programming and Scripting

Julian day to dates in YEAR-MONTH-DAY

hello, I have many files called day001, day002, day003 and I want to rename them by day20070101, day20070102, etc. I need to do it for several years and leap years as well. What is the best way to do it ? Thank you. (1 Reply)
Discussion started by: Ggg
1 Replies

3. Shell Programming and Scripting

Replace data of a file with data from another file using shell scripting.

Dears, I'm new to shell scripting and i was wondering if you can help me with following matter. I have a file containing 400,000 records. The file contains two columns like: 00611291,0270404000005453 25262597,1580401000016155 25779812,1700403000001786 00388934,1200408000000880... (1 Reply)
Discussion started by: paniklas
1 Replies

4. AIX

wtmp file - is there a patch to export the data another file each day?

sorry for being a noob, i am trying to find which user accessed the server at what time and there ip address at first i used who command but the output didn't contain the ip address then i used the last command which provided me with the ip of the users but when i searched i searched and found that... (1 Reply)
Discussion started by: hercules_1010
1 Replies

5. Shell Programming and Scripting

Append data to new row in CSV file every day

Hi All I will run the same script every day in corn and output should go to same CSV file but in different row with dates on it. Below is my example in attached format. Script i am using to collect switch port online DATE=`date '+%d-%m-%y'` for f in `cat... (1 Reply)
Discussion started by: ranjancom2000
1 Replies

6. UNIX for Dummies Questions & Answers

Move the files between Current day & a previous day

Hi All, I have a requirement where I need to first capture the current day & move all the files from a particular directory based on a previous day. i.e move all the files from one directory to another based on current day & a previous day. Here is what I am trying, but it gives me errors.... (2 Replies)
Discussion started by: dsfreddie
2 Replies

7. Shell Programming and Scripting

Script to check if last modified day is previous day

Hi, I would like to write a script that checks if a file ('counter') was modified the previous day, if so erase its contents and write 00000000 into it. For e.g. if the file 'counter' was last modified at 11.30pm on 24th May and the script runs at 12.15am of 25th May, it should erase it's... (1 Reply)
Discussion started by: hegdepras
1 Replies

8. Shell Programming and Scripting

Script to find previous month last day minus one day timestamp

Hi All, I need to find the previous month last day minus one day, using shell script. Can you guys help me to do this. My Requirment is as below: Input for me will be 2000909(YYYYMM) I need the previous months last day minus 1 day timestamp. That is i need 2000908 months last day minus ... (3 Replies)
Discussion started by: girish.raos
3 Replies

9. UNIX for Dummies Questions & Answers

I want to seperate my data by time of day

Hi, I'm a newbie to unix. I have a txt file with my data, a list of events. Each event comes with a unix time. I want to seperate a months worth of events into those that occur during the day, and those at night. I have no clue how to go about this, please can someone push me in the right... (6 Replies)
Discussion started by: pmasterkim
6 Replies

10. Shell Programming and Scripting

Write a shell script to find whether the first day of the month is a working day

Hi , I am relatively new to unix... Can u pls help me out to find out if the first day of the month is a working day ie from (Monday to Friday)...using Date and If clause in Korn shell.. This is very urgent. Thanks for ur help... (7 Replies)
Discussion started by: phani
7 Replies
Login or Register to Ask a Question