date and filename

date and filename

Post by David Funnel » Thu, 31 Jan 2002 14:49:02



need help on this one!!

I trying to write a script that will
execute webalizer web stats program
mail the resulting stats file (using another script  called mail_files)
delete the stats file

problem is webalizer creates a report with a filename based on the date
eg    usage_200201.html (for january 2002)

any ideas on how to create a variable name that will refer to the
current monthly file?????

cheers David

 
 
 

date and filename

Post by Chris F.A. Johnso » Thu, 31 Jan 2002 15:52:06



> need help on this one!!

> I trying to write a script that will
> execute webalizer web stats program
> mail the resulting stats file (using another script  called mail_files)
> delete the stats file

> problem is webalizer creates a report with a filename based on the date
> eg    usage_200201.html (for january 2002)

> any ideas on how to create a variable name that will refer to the
> current monthly file?????

        curmonthfile=`usage_`date +%Y%m`.html

--
    Chris F.A. Johnson                        http://cfaj.freeshell.org
    ===================================================================
    My code (if any) in this post is copyright 2002, Chris F.A. Johnson
    and may be copied under the terms of the GNU General Public License

 
 
 

date and filename

Post by Tapani Tarvaine » Thu, 31 Jan 2002 15:59:08



> webalizer creates a report with a filename based on the date
> eg    usage_200201.html (for january 2002)

> any ideas on how to create a variable name that will refer to the
> current monthly file?????

How about

file=`date +'usage_%Y%m.html'`

--
Tapani Tarvainen

 
 
 

1. Capturing an a filename that contains the month/date in filename ie fileMMDD

I am trying to capture a filename that is named "fileMMDD" (MM=month,
DD=day).

Everyday this filename will be change to the current date. However, I need
to ftp this file to another server and when it is on the other server I have
to rename that file "fileMMDD.done" . I can do the ftp part and could do
this entire process only if I knew the exact name of the filename.

The directory that this file is located in will contain upto 30 other files
with the same file naming convention, but they will each a a differnt date,
ie. file0805, file0809, file0810, etc...

Any suggestions would be most appreciated.

2. PPP on Solaris2.4 Success?

3. renaming files from filename to filename-date

4. News Server

5. Matrox Mystique ands X.

6. mount: /dev/hd1a is not a block device. Help?

7. How Can I Append Date To a Filename ?

8. NFS clients get message remote program not registered

9. Solaris filenames dated "Dec 31 1969" ?

10. How can I use today's date a filename?

11. Copy files of a certain period (date indicated in the filenames)

12. Modification Date as suffix to filename.

13. Y2K Server bug not NcFTP and Y2K issues on filename dates