Results 1 to 8 of 8

Thread: Syncing with rsync (problems)

  1. #1
    Join Date
    May 2011
    Beans
    17

    Angry Syncing with rsync (problems)

    I've been trying to use rsync to copy my home directory to an external hard drive. I researched commands and think this should be right, but it's not working. Can someone tell me what I'm doing wrong?

    Entered in command line:
    rsync -av /home/mark /media/Mark's Backup

    (the first part is my home directory and the second part is the name of my external hard drive)

    Is there something obvious I'm doing wrong? Sorry, I'm new to command line.

    Thank you in advance.

  2. #2
    Join Date
    Nov 2007
    Location
    .mx
    Beans
    305
    Distro
    Ubuntu

    Re: Syncing with rsync (problems)

    Try
    Code:
    rsync -av /home/mark /media/Mark\'s Backup
    At the very least, you need to escape quotes with the backslash (\).
    Last edited by patryk77; September 23rd, 2011 at 12:19 AM.
    Shamelessly plugging my GLog! (GeekLog) in every post I can
    If your problem is solved, please do take the time to mention it and Mark the Thread as Solved!

  3. #3
    Join Date
    Jun 2009
    Location
    Chicago Suburbs
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Syncing with rsync (problems)

    If Mark's Backup is the label you gave it and it gets automounted then it should work with quotes. Since converting to Linux I stopped using spaces and even Windows does not accept some special characters. I use CamelCase or Under_score as styles for labels or mount points. Linux is also case sensitive.

    rsync -av /home/mark /media/'Mark's Backup'

    There also are ways to add a space with escape and the 040 ACSII character but I never do that, so I do not know it.

    An example of a bash file to do backups with some explanations:
    Originally Posted by MountainX View Post #20 also other backup apps
    http://ubuntuforums.org/showthread.p...ghlight=backup
    Sample rsync file, use a text editor and paste into a file & name it mybackup.sh

    Backup to external with check of mounted & email
    http://ubuntuforums.org/showthread.php?t=1701292

    rsync confirmation list:
    http://ubuntuforums.org/showthread.php?t=1692800
    Check for mount of backup partition
    http://ubuntuforums.org/showthread.php?t=1701292
    For info on UEFI boot install & repair:
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to close thread when/if answered completely.







  4. #4
    Join Date
    May 2011
    Beans
    17

    Re: Syncing with rsync (problems)

    Quote Originally Posted by patryk77 View Post
    Try
    Code:
    rsync -av /home/mark /media/Mark\'s Backup
    At the very least, you need to escape quotes with the backslash (\).
    Ah, I had a feeling it was something stupid like that! I'll try that right now, thanks.

    From what I understand, I can just run this command whenever I plug in my hard drive and it will sync it with my home folder (delete deleted files, add new files, and change changed files)?

  5. #5
    Join Date
    Nov 2007
    Location
    .mx
    Beans
    305
    Distro
    Ubuntu

    Re: Syncing with rsync (problems)

    Quote Originally Posted by patryk77 View Post
    Try
    Code:
    rsync -av /home/mark /media/Mark\'s Backup
    At the very least, you need to escape quotes with the backslash (\).

    Oops... you should also at least escape the space

    Code:
    rsync -av /home/mark /media/Mark\'s\ Backup
    @oldfred: I believe you mean:
    rsync -av /home/mark /media/"Mark's Backup"

    As 3 single quotes would be considered incomplete?
    Shamelessly plugging my GLog! (GeekLog) in every post I can
    If your problem is solved, please do take the time to mention it and Mark the Thread as Solved!

  6. #6
    Join Date
    May 2011
    Beans
    17

    Re: Syncing with rsync (problems)

    Quote Originally Posted by oldfred View Post
    If Mark's Backup is the label you gave it and it gets automounted then it should work with quotes. Since converting to Linux I stopped using spaces and even Windows does not accept some special characters. I use CamelCase or Under_score as styles for labels or mount points. Linux is also case sensitive.

    rsync -av /home/mark /media/'Mark's Backup'

    There also are ways to add a space with escape and the 040 ACSII character but I never do that, so I do not know it.

    An example of a bash file to do backups with some explanations:
    Originally Posted by MountainX View Post #20 also other backup apps
    http://ubuntuforums.org/showthread.p...ghlight=backup
    Sample rsync file, use a text editor and paste into a file & name it mybackup.sh

    Backup to external with check of mounted & email
    http://ubuntuforums.org/showthread.php?t=1701292

    rsync confirmation list:
    http://ubuntuforums.org/showthread.php?t=1692800
    Check for mount of backup partition
    http://ubuntuforums.org/showthread.php?t=1701292
    Putting in quotes worked! Thanks!

  7. #7
    Join Date
    Jun 2009
    Location
    Chicago Suburbs
    Beans
    Hidden!
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: Syncing with rsync (problems)

    @patryk77 of course you were correct and marklovescoffee must have used double quotes. Part of why forum works as even if we miss one thing someone else fixes it.

    marklovescoffee - glad it worked.

    Script will not run automatically when you plug it in if it is just a script. Not sure where you could put it to see the new USB drive being automounted.
    For info on UEFI boot install & repair:
    http://ubuntuforums.org/showthread.php?t=2147295
    Please use Thread Tools above first post to close thread when/if answered completely.







  8. #8
    Join Date
    Aug 2011
    Beans
    322
    Distro
    Xubuntu 13.04 Raring Ringtail

    Re: Syncing with rsync (problems)

    If you want to delete files from the destination that are not on the source, you need rsync -av --delete . . . . . Otherwise it will update files, add files that are not there, but will not delete files.

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
  •