Question about using rsync as a way to backup iTunes library....

Discussion in 'Mac Basics and Help' started by simon lefisch, Jun 25, 2016.

  1. simon lefisch macrumors 6502a

    simon lefisch

    Joined:
    Sep 29, 2014
    #1
    Hey everyone,

    I have my iTunes library stored locally on my MBP, and I also have a copy of all the media on my 2008 R2 server. Once I start adding more media to my local library, will rsync copy the newly added files to my server or will it try to copy the entire library over again?
     
  2. I'm a ROb macrumors member

    Joined:
    Aug 14, 2007
    Location:
    Netherlands
    #2
    Rsync should only copy the new files and the changed files.

    Not sure, but I think iTunes changes to files every time you listen to them (to update the 'number of times played' and the 'last played at' fields).
     
  3. simon lefisch thread starter macrumors 6502a

    simon lefisch

    Joined:
    Sep 29, 2014
    #3
    But those changes would be made in the iTunes library file and not the actual media, correct?

    If so then that's ok as I keep my iTunes library file sync'd elsewhere. I'm only backing up the media.
     
  4. grahamperrin, Jun 25, 2016
    Last edited: Jun 25, 2016

    grahamperrin macrumors 601

    grahamperrin

    Joined:
    Jun 8, 2007
    #4
    I assume so. Some file types may be associated with a mixture of metadata data and metadata, but in many (most?) cases the metadata is separate.

    So (as you say), a library file.

    Plus there may be changes to extended attributes of media files, but I don't know whether the iTunes interface uses those attributes.
     
  5. simon lefisch thread starter macrumors 6502a

    simon lefisch

    Joined:
    Sep 29, 2014
    #5
    Gotcha.

    So most likely (I'm 99.9% sure) all the playback data/favs/etc are stored in the iTunes library file, but if I change any of the ID3 metadata, that would change some of the file attributes so it would have to be re-sync'd. Most of the songs I have are MP3 and I know that info typically carries over with the media itself.
     
  6. grahamperrin macrumors 601

    grahamperrin

    Joined:
    Jun 8, 2007
    #6
    Glancing at http://id3.org/ an ID3 tag is "within … file" so if rsync (or whatever you use) does not handle deltas, the sync/backup will be of the file in its entirety.

    Looking ahead, I guess that in 2017 there'll be APFS with macOS 10.13 SMB client support for deltas. It's too soon for me to guess whether your 2008 R2 server will lend itself to that combination.
     
  7. simon lefisch thread starter macrumors 6502a

    simon lefisch

    Joined:
    Sep 29, 2014
    #7
    Awesome, that's what I was looking for. Many thanks for your help
     
  8. simon lefisch thread starter macrumors 6502a

    simon lefisch

    Joined:
    Sep 29, 2014
    #8
    @grahamperrin I have created a batch script that will run rsync3 (grabbed the rsync file CCC since it is an updated version [3.0.6] and named it rsync3). When it runs, it seems like it is still transferring all the files, but I cannot be sure. This is the code I have:

    Code:
    rsync3 -rv --progress <source> <destination>
    Is this code sufficient to run so it updates any new/modified files without transferring everything?

    I did read thru the man but didn't really find anything specific to what I am looking for. Thanks for any help/explanation you can provide.
     
  9. mfram, Jul 15, 2016
    Last edited: Jul 15, 2016

    mfram macrumors 65816

    Joined:
    Jan 23, 2010
    Location:
    San Diego, CA USA
    #9
    Yes, that should do it. I use '-av' instead of '-rv'. It might not make a difference in your case.

    Specifically, I use these commands to copy my iTunes library to a remote server over SSH.

    In my case, I'm interested in my music being transferred. Not movies, etc. And my excludes file has stuff like the Podcasts directory.

    Code:
    rsync -av -e ssh --progress --delete --exclude-from=~/Documents/sync-itunes-excludes.dat ~/Music/iTunes/iTunes\ Music server:media/iTunes/
    scp ~/Music/iTunes/iTunes\ Music\ Library.xml server:media/iTunes/
    
    Code:
    cat Documents/sync-itunes-excludes.dat 
    iTunes Music/Podcasts/*
    iTunes Music/Movies/*
    
     
  10. simon lefisch thread starter macrumors 6502a

    simon lefisch

    Joined:
    Sep 29, 2014
    #10
    Great, thanks for the response. Much appreciated
     
  11. grahamperrin macrumors 601

    grahamperrin

    Joined:
    Jun 8, 2007
    #11

Share This Page