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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cron reports cat error

Status
Not open for further replies.

reinstalled

IS-IT--Management
Feb 18, 2003
178
Hi all,

I have a cron job that runs a backup script.
The script does a simple Sybase db dump to file.
We have 20 servers out there running the same script with no errors whatsoever. While this error does not hamper the script in any apparent way I would still like to understand what's happening.

The error is: cat: write error: Bad address

The difference with this server is that it runs two databases and the dump operation happens at the same time for both.
My theory, such as it is, is that sometimes both databases are trying to write to the same tmp file at the same time.
Does this hold any water? Something else I should be looking at?

Thanks,
 
What part does the "cat" play in your backup? Can you give some lines of code?
 

Well right now I have gotten to the end of the script looking for such instances that cat is called but it looks like it's calling a couple other scripts as well before finishing. So I'm still in tracker mode looking for where cat may be called in the other scripts. Let go through today and I'll update as to where I am at.

Thanks for the reply.
 
Well, just as something to look for when you do find it, I've seen a cat error similar to this when you are cat'ing a file to a pipe that has the same file as the final output from the pipe. That is, something like...
Code:
cat /path/to/file.dat | somescript.sh | someprog > /path/to/file.dat
The problem is that cat moves the file pointer when it reads, but that redirection to the same file zeros the file pointer, making a "bad address" on the next read. Or something like that. This may not be it exactly since it's a "write error", but look for something similar.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top