Results 1 to 6 of 6

Thread: Cron rsync command question

  1. #1
    Join Date
    Feb 2007
    Beans
    871
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Cron rsync command question

    I have setup rsync to backup a drive everyday using cron. This is the command:

    0 1 * * * /usr/bin/rsync -av --stats --delete /media/sdc1/ /media/sdd1/

    My understanding is that the "--delete" will delete any files on the backup drive that are not on the source drive....but it doesn't. The backup drive has accumulated all the files that were deleted on the source drive. If the rync command is correct then why are the files not being deleted or if the rsync command is incorrect please supply the correct command.
    Thanks

  2. #2
    Join Date
    Feb 2007
    Beans
    871
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: Cron rsync command question

    The cron was setup as a user not root.
    Thanks

  3. #3
    Join Date
    Feb 2007
    Beans
    871
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: Cron rsync command question

    anyone?

  4. #4
    Join Date
    Feb 2009
    Location
    Dallas, TX
    Beans
    6,325
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Cron rsync command question

    Are the source and destination mounted partitions or devices?
    What kind of filesystem do they have?

    I would recommend using the log options to check for details:
    Code:
    rsync  -av  --log-file=/path/to/log/file
    Regards.

  5. #5
    Join Date
    Feb 2007
    Beans
    871
    Distro
    Ubuntu 12.10 Quantal Quetzal

    Re: Cron rsync command question

    Quote Originally Posted by papibe View Post
    Are the source and destination mounted partitions or devices?
    Yes they are mounted...I'm not sure I could use them if they weren't mounted. Also they are devices...harddrives...sdc1 and sdd1

    What kind of filesystem do they have?
    ext4

    I would recommend using the log options to check for details:
    Code:
    rsync  -av  --log-file=/path/to/log/file
    Regards.
    What details am I looking for?

    Getting back to my original question....is the "--delete" correctly being used or not?

  6. #6
    Join Date
    Feb 2009
    Location
    Dallas, TX
    Beans
    6,325
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Cron rsync command question

    Quote Originally Posted by williammanda View Post
    What details am I looking for?
    What files are being transfer, what is being deleted, error messages from transfers and deletions.

    This could bring to light some permission errors, links, other partitions under it, etc.

    Quote Originally Posted by williammanda View Post
    Getting back to my original question....is the "--delete" correctly being used or not?
    Yes. That is the purpose of that option: to make an exact copy of the source.

    Regards.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •