Mail Status File with the File Name Changes by Date

Mail Status File with the File Name Changes by Date

Post by Yon-Chun Ch » Wed, 15 Sep 1993 00:13:08



Can someone help me here?

We have a program that runs every night and creates an output file in the
format of "status.year_month_date". For example, it creates a file
for yesterday (Sep 12, 1993) as "status.930912".

I wonder is it possible to write a perl or awk program to mail the
status file to users next morning automatically? I have trouble to make
awk interactive with an existing file.


-Yon

 
 
 

Mail Status File with the File Name Changes by Date

Post by Terry Mies » Wed, 15 Sep 1993 02:48:09


|>
|> Can someone help me here?
|>
|> We have a program that runs every night and creates an output file in the
|> format of "status.year_month_date". For example, it creates a file
|> for yesterday (Sep 12, 1993) as "status.930912".
|>
|> I wonder is it possible to write a perl or awk program to mail the
|> status file to users next morning automatically? I have trouble to make
|> awk interactive with an existing file.
|>

|>
|> -Yon

Not to knock awk or perl, but why bother?

try:
 mail user1 user2 user3 <status.`date +"%y%m%e`
--

Terry Miesse             | If I could speak for
Internal Customer Support| my employer, I wouldn't
Mead Data Central        | have time to read News.


 
 
 

1. File Names and File Dates

Hello Everyone,

I wrote a program that reads the contents of a directory. I am using
"dirent.h" to get my file name.

I also need to get the file date and, for that, I am using stat(). The
problem is that when you use stat(), it reads the entire file system to
get to the filename that you have specified and thus it reads each file
twice for each call.

Example:
Fl_Name        readdir()        stat()
file.1            Get name        get date for file.1
file.2            Get name        read file.1,  get date for file.2
file.3            Get name        read file.1, read file.2, get date for
file.3

and so on.

When you have a large sample (600,000+) files, you can imaging that by
the time it gets to the 250,000 file, it is taking up to 15 minutes to
get the date of the 251,000 file. On my test, it took close to three
hours to read, and get the date of the 250,000 files.

Is there a better way of doing this? Help!!!!

Thank you

2. Clariion/SD_MAX_THROTTLE

3. Scripting Help: tar a dir with time and date as file tar file name..................TIA

4. linux (Tux) promotional material?

5. batch file using system date in file name??

6. PowerMac 7200/75 - which linux?

7. Need help editing (sed) a file without changing the date of the file.

8. Color in Xwindows

9. Archiving files in "date folders" based on date and time file generated

10. Change File status change time

11. How to change file "last status change time"?

12. change to new gid or new group name all files of given group name or gid