Im having a problem with my script... dont now how to finish.
I have a more than 50 files in folder where is myscript. I manage to make this script work but i have a problem with files i want to send. We talk about .log files. My script look like this:
but i have a problem because i dond need subscriber.log i need subscriber.log from day before etc. subscriber.log.2009-08-15 and it should be generated for every day but a date should be from yesterday.
To keep the forums high quality for all users, please take the time to format your posts correctly.
First of all, use Code Tags when you post any code or data samples so others can easily read your code. You can easily do this by highlighting your code and then clicking on the # in the editing menu. (You can also type code tags
```text
and
```
by hand.)
Second, avoid adding color or different fonts and font size to your posts. Selective use of color to highlight a single word or phrase can be useful at times, but using color, in general, makes the forums harder to read, especially bright colors like red.
Third, be careful when you cut-and-paste, edit any odd characters and make sure all links are working property.
but i dont know where to put this line? before grep ? Is this the first line in my script? I also have to automate this script so it can work every day... i need that this script use log file from yestrday from all logs in this dir.
#!/bin/sh.
find <directory> -mtime +1 -name subscriber* -exec ls -el {} \; >> temp.file
#cut the last field to get the file name and assign it to a variable filname
more $filname | grep Purchase subscriber.log > dacha
ftp -v -n "10.15.20.245" <<cmd
user "fun" "fun"
send dacha
quit
cmd
this code give me log file from today 21 and i need a file from yestrday subscriber.log.2009-08-20 my last field is subscriber.log and no date...
#!/bin/sh.
find <directory> -mtime +1 -name subscriber* -exec ls -el {} \; >> temp.file
#cut the last field to get the file name and assign it to a variable filname
more $filname | grep Purchase subscriber.log > dacha
ftp -v -n "10.15.20.245" <<cmd
user "fun" "fun"
send dacha
quit
cmd
this code give me log file from today 21 and i need a file from yestrday subscriber.log.2009-08-20 my last field is subscriber.log and have no date... This log i generated just now and a dont need log from today... i need a log from 2009-08-20
---------- Post updated at 01:44 PM ---------- Previous update was at 01:34 PM ----------
? help
---------- Post updated at 01:56 PM ---------- Previous update was at 01:44 PM ----------
I dont need last file... i need file before that....