[mdlug] Lurkers Please Talk to Me

Carl T. Miller carl at carltm.com
Thu May 19 20:31:08 EDT 2011


Brian Brodsky wrote:
> I usually do not have questions and most things seem to get adequate
> responses. But since you mention it I have been having a problem with
> rsyncs (inside a cron job script) to new external usb drives. I think
> the issue is related to these drives having some sort of sleep mode. I
> tried to get around this by doing an ls command to the drive a couple
> times with sleep commands. The directory commands seem to work now but
> when it tries to rsync sometimes it gets errors writing to the drives
> saying it is a read only file system. Which I had rsynced to the same
> partition earlier in the day. Any suggestions?

You might want to put a test in your script to find if the
filesystem has become read only.  It could be as simple as
touching a file and seeing if you get an error.  If you do
get an error, remount the drives.

Incidentally, I usually put tests in scripts like this to
make sure the filesystems are mounted and certain files or
directories exist before launching the rsync command.  If
anything isn't right, I have the script send me email letting
me know what the problem is.

Let me know if you'd like to see a sample of this is a
shell script.

c





More information about the mdlug mailing list