Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


results of rsync script to firewire device when device is not attached

Posted on 2006-04-12
Medium Priority
Last Modified: 2010-04-21
OS X 10.4.5, Powerbook
rsync  version 2.6.0  protocol version 27

I am running a cronjob nightly rsync script to an attached local firewire drive.  The name of the external volume is 'fibonacci'.  The script is:

* 3 * * 1 time rsync -a -b --suffix=# --backup-dir=buMonday /Users/cabenson /Volumes/fibonacci

Things are generally working as expected.  However, if the drive is not attached or mounted for some reason, the script will generate a new directory at the /Volumes/fibonacci location.

I attempt to remove that inadvertently generated directory with

rm -R /Volumes/fibonacci

When I do, I get a lot of 'Directory not empty' errors.  Sometimes  the rm -R process hangs as well.

Is there something unique about the directory tree that rsync is creating in /Volumes (when the ext firewire drive is mistakenly unattached) ?

Question by:jesterepsilon
LVL 23

Accepted Solution

brettmjohnson earned 1000 total points
ID: 16439937
Test for the existence of the directory /Volumes/fibonacci first by prefacing the command with
[ -d /Volumes/fibonacci ] && 


Assisted Solution

sda100 earned 1000 total points
ID: 16443928
Hi there jesterepsilon

Assuming the directory is always going to be there (because you need it there to mount to), you can test for the mount instead, like so (you'll have to grep for the correct string though - this is just my example):

  mount | grep '/dev/scd0 on /media/rev type udf (rw)'
  if [ $RETVAL -eq 0 ] ; then
    # OK to proceed

Steve :)
LVL 62

Expert Comment

ID: 16661090
No comment has been added to this question in more than 21 days, so it is now classified as abandoned.
I will leave the following recommendation for this question in the Cleanup topic area:

Split between brettmjohnson http:#16439937 and sda100 http:#16443928

Any objections should be posted here in the next 4 days. After that time, the question will be closed.

EE Cleanup Volunteer

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
A metadevice consists of one or more devices (slices). It can be expanded by adding slices. Then, it can be grown to fill a larger space while the file system is in use. However, not all UNIX file systems (UFS) can be expanded this way. The conca…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses
Course of the Month11 days, 2 hours left to enroll

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question