Results 1 to 2 of 2

Thread: rsync based backup solution doesn't delete files

  1. #1
    Join Date
    Jul 2010
    Beans
    2

    rsync based backup solution doesn't delete files

    Hi all,

    I'm using cron to run rsync every night to backup from one hard drive to another. Unfortunately, I can't seem to get the --delete option to work through cron - although it seems to work just fine when I run rsync with the same arguments on test directories using my own user. This makes me think it's a user/permissions problem (although rsync is indeed copying the files as desired - it's just not deleting files on the backup drive which I've removed from the working drive).

    The command I'm running is:

    /usr/bin/rsync -avltr --delete /home/mbeeby /mnt/backup2

    Does anyone have any ideas as to what I'm doing wrong?

    Many thanks,

    -Morgan

  2. #2
    Join Date
    Oct 2009
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: rsync based backup solution doesn't delete files

    In order to use -a to apply the correct permissions/owners you would need to run it as root.

    Does it work when you run it with sudo?

    FYI: -a = -rlptgoD

    You can run rsync like so:

    Code:
    rsync --archive --verbose --delete /home/mbeeby /mnt/backup2
    I've got mine set to use -i (--itemize-changes) so that it will show me what it is doing, instead of using verbose mode.

    EDIT: If you are just testing it to make sure it's deleting files, you can add --dry-run so that it doesn't actually modify anything.
    Last edited by CharlesA; September 8th, 2010 at 04:49 PM.
    Come to #ubuntuforums! We have cookies! | Basic Ubuntu Security Guide

    Tomorrow's an illusion and yesterday's a dream, today is a solution...

Tags for this Thread

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
  •