Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

CD (write) works perfectly when root but not when cron

0 views
Skip to first unread message

linuxlov...@yahoo.com

unread,
Feb 6, 2006, 6:43:15 PM2/6/06
to
I have this weird problem which I do not seem to be able to
troubleshoot (in my Fedora Core 4 system):

I have a script that writes selected data into a CDRW disc (/dev/cdrom
which happens to also be /dev/hdc). That script works perfectly when I
execute it manually, logged as 'root'.

I tried to automate this into a nightly backup, by placing the script
in /etc/cron.daily, which means it will be run by the cron daemon every
night. I expected to find the CD with the data ready for me in the
morning, but instead I found the following in /var/log/messages:

========= START QUOTE ===========
hdc: command error: status=0x51 { DriveReady SeekComplete Error }
hdc: command error: error=0x54 { AbortedCommand LastFailedSense=0x05 }
ide: failed opcode was: unknown
end_request: I/O error, dev hdc, sector 0
Buffer I/O error on device hdc, logical block 0
========== END QUOTE ===========

I tried running the script again manually (logged as 'root') and it has
no problem whatsoever completing. This strange I/O error occurs only
when the script is spawned by the cron daemon.

Hmmm.... weird, isn't it?

Anyone has any explanation for this? How should I begin to troubleshoot
a problem like this (doesn't seem like a hardware problem)? Could that
be related to the new security scheme (SELinux)?

Any hint or tip would be greatly appreciated.

Thanks,
Lynn

Scott Lurndal

unread,
Feb 6, 2006, 8:55:58 PM2/6/06
to

You may wish to consider posting your script. We have no idea
what it is doing.

scott

linuxlov...@yahoo.com

unread,
Feb 7, 2006, 8:05:38 PM2/7/06
to
The script doesn't do much: it just archives entire home directory in a
tar file, then writes the file to the CD using cdrecord as follows:

mkisofs -J -R -o /home/backup/cdimage.raw /home/backup/stagingdir
cdrecord /home/backup/cdimage.raw

Again, I don't think anything in the script is flawed, because it works
perfectly when I am logged as 'root' and running it from the command
line. The problem only exhibits itself when run by cron.

Baffling, isn't it?

Bit Twister

unread,
Feb 7, 2006, 8:21:49 PM2/7/06
to

Normally, not.
Usuall problem is cron environment is not the same as command line.
Fix the PATH or fully qualify program names.

Scott Lurndal

unread,
Feb 7, 2006, 9:31:09 PM2/7/06
to

Might want to also consider specifying -dev, -speed and -sao
to the command line for cdrecord.

scott

Linux Lover

unread,
Feb 8, 2006, 9:17:38 PM2/8/06
to
OK - I solved the problem. It turns out that for some strange reason
this problem coincided with sudden increase of the data to be backed up
in such a way that it exceeded the 700MB CD limit.

I excluded some data temporarily (until I replace the CDRW with DVDRW)
and the cron job now works perfectly.

Thank you all for your guidance. It truly helped me look at the right
direction.

Lynn

0 new messages