Keeping Files Deleted Off Computer


#1

I’m using duplicacy to backup my iTunes media folder which includes downloaded movies.

If I delete the movie from my local computer (to free up space, perhaps), how can I ensure that the files are not deleted by duplicacy in the backup? I’d like to ensure that I always have a backup copy of the movies in case they get pulled from the iTunes store.

Thank you!


#2

When duplicacy does a backup, it creates a new revision. That revision is read only so nothing is modified in subsequent backup runs.

The only way to lose data from a backup is when you prune revisions. Hence as long as you never prune, you will not lose any of the films that were backed up.

What happens though is that after you delete a film, the future backups will not have the film either (since it doesn’t exist in your local storage anyhow). But all previous backup revisions util the moment you deleted the film will still contain it.

Does this make sense?


#3

It does, thank you for answering.

Is there a way to search through revisions for a particular file? Lets say that I delete a file off my computer today and then want to restore it 6 months from now. During that period, I would presumably have made other changes to the library so there would have been a lot of intermediate revisions.


#4

Essentially what you are asking is – “how can I enumerate all files that ever existed in a specific folder across revisions”.

You cannot do that with a single command, but you you do it with a short script – first, enumerate all revisions with duplicacy list, then enumerate files in each revision and grep by folder path with duplicacy list -r <revision> -files | sort -u, etc.

Something like:

#!/bin/bash
{
    duplicacy list | grep "Snapshot" | cut -d ' ' -f 4 | while read rev
    do
        duplicacy list -r $rev -files | grep "Music/iTunes/Movies"
    done
} | sort -u

But that is too much work, and I think this is all wrong approach for what you are trying to achieve – with duplicacy you get all the drawbacks of a versioned encrypted deduplicated backup solution and none of the benefits of what duplicacy excels at:

  1. Encryption – you don’t need to encrypt iTunes media files
  2. Deduplication – Media files are not deduplicatable, especially DRM protected ones from iTunes,
  3. Compression – Media files are not compressible. You don’t save space, you just waste CPU time compressing them.
  4. Versioning – media files never change,no versions to keep track of, and yet keeping versioned snapshots of your iTines library just adds complexity of going through all snapshots when you need to find a file that existed during certain period of time.

Instead, I would recommend “1-way-sync-with-rename” approach to backup your iTunes library.

“1-way” part of this will ensure that you only add data there, and since movie names are unique you will never overwrite;
“rename” will ensure that if you local file gets corrupted you won’t overwrite the good version in backup with the bad one.

As a result you will have complete set of files at the destination, as-is, ready to be copied.

To accomplish this you can use most of existing tools - like rsync with -b flag, Panic’s Transmit, open source CyberDuck to name a few.


#5

If you don’t pass a revision to duplicacy list -files, it spits out files for all revisions, right? So I think this could probably be done with a one-liner to find which revisions contain a particular file (for example, Movie.mp4).

$ duplicacy list -files | grep "created at\|Movie.mp4"

#6

Ha! indeed, it never occurred to me that -r is in fact optional argument. your version will work just fine.