Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Empty a file

Status
Not open for further replies.

hkhan12

IS-IT--Management
Mar 23, 2005
2
CA
I have a trace file, lets say trace0.dat

I need to make this file empty every Monday, 9:00 am.

I have created a file called dlttrace as follows and saved it:
> trace0.dat

Now I put this file dlttrace in crontab as follows:

0 9 * * 1 /trace/dlttrace >> dlttrace.out 2>&1

On Monday 9:00 am, this script did run and my output file dlttrace.out generated but its empty and trace0.dat file is NOT empty, still it has data which I wanted to remove it from the file.

Any idea or help would be highly appreciated.

Thank you,

Hasham
 
Replace this:
> trace0.dat
By something like this:
> /path/to/dir/trace0.dat

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Set the FULL path for trace0.dat in the script:

> /topdir/nextdir/otherdir/trace0.dat

[ponder]

----------------------------------------------------------------------------
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
 
Ooops, I need to type faster. [3eyes]

----------------------------------------------------------------------------
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top