Author Topic: Writing a program to sync music files  (Read 273 times)

Offline Kryzon

  • Jr. Member
  • **
  • Posts: 27
Writing a program to sync music files
« on: October 20, 2017, 06:00:11 AM »
I did a backup of my music folder (which contains several loose files as well as other directories) into a few DVDs. Nothing fancy, just data discs.


As time passed I added more music to my folder. These haven't been backed up yet.
I don't remember what has been added recently vs what's already been backed up.


What's the best course of action:
 -To back everything up again, including files \ directories that have already gone through that?
- To write a simple tool that compares the contents of my main music folder with the (aggregated) content of the DVDs, then do a backup of only the new stuff? (I have access to BMax or Python)


First world problems

Offline MikeHart

  • Sr. Member
  • ****
  • Posts: 362
Re: Writing a program to sync music files
« Reply #1 on: October 20, 2017, 06:14:56 AM »
I would go with the last option. Keeps backup times to a minimum.

Offline MikeHart

  • Sr. Member
  • ****
  • Posts: 362
Re: Writing a program to sync music files
« Reply #2 on: October 20, 2017, 06:18:48 AM »
Last year i got an NAS, a mycloud from WD. It is perfect for something like this.
As my wife loves watching sitcoms and loves her ipad pro, i have started to store our dvd collection on it. So she can watch it from there. Works perfect.

Offline Qube

  • Administrator
  • Hero Member
  • *****
  • Posts: 504
Re: Writing a program to sync music files
« Reply #3 on: October 20, 2017, 06:45:29 AM »
This is probably irrelevant but...

As a Mac user my fave backup app is SuperDuper. It's setup to do mirror backups, which means it only copies or replaces new and changes files.

I have six USB drives. Three are for certain types of data storage and the other three are for backups of those drives. Each backup is always a mirror, as in it copies new data, replaces data or erases data as needed.

If you are unsure what you have then I would first create a complete new full backup and then stick to a strict regime of compare / add / replace.
Until the next time...

Online Derron

  • Sr. Member
  • ****
  • Posts: 257
Re: Writing a program to sync music files
« Reply #4 on: October 20, 2017, 08:20:13 AM »
If you want to copy only new data in a folder to another one (might be a remote share too) then just use rsync?!

There are also GUI-tools for this command line tool to make it easier to execute properly.

What it does? Depending on the configuration it synchronizes these two folders - or just synchronizes A to B or ...
So at the end (see your desire/request) it copies all files from A which are not existent on B or newer than the same named file on B.


Such things are called "incremental backups" and if done properly, this also includes symlinks. So you could have
path\backup-2017-10-19
path\backup-2017-10-20

path\backup-2017-10-21
...
And all containing the complete "music list". But in reality the files are just symbolic links to the real file when it was copied to the backup folder/share the first time. So if you once remove the music file from "21" then it is still existing in 20 and 19 - but only occupying space one time. This allows to see _when_ you added a music file to your share (without relying on file date stamps).

Another benefit of rsync is its capability to run on remote connections. So it is easy to sync eg. to your webspace/server/cloud.


bye
Ron

Offline Qube

  • Administrator
  • Hero Member
  • *****
  • Posts: 504
Re: Writing a program to sync music files
« Reply #5 on: October 20, 2017, 04:57:45 PM »
Have you tried Robocopy? - It's a free command line app from Microsoft that allows you to copy files / folders from A to B but has many options like being able to copy / replace files that are newer / changed.
Until the next time...

Offline Kryzon

  • Jr. Member
  • **
  • Posts: 27
Re: Writing a program to sync music files
« Reply #6 on: October 22, 2017, 04:32:28 AM »
I do want to keep backup times to a minimum. Thanks for all the ideas and tips guys, I'm checking them right now.

If you want to copy only new data in a folder to another one (might be a remote share too) then just use rsync?!
Since the backup is spread on various DVDs it'd have to be a "new data in a folder to several other folders" kind of operation.
I didn't back it all up into one place as I lacked an external HDD, but like you said it would've made synchronisation much easier...

Offline GW

  • Jr. Member
  • **
  • Posts: 90
Re: Writing a program to sync music files
« Reply #7 on: October 23, 2017, 09:38:12 AM »
I use a tool called 'syncfolders (v 3.4.234)'. It's free, lets you define rules for backup, It might meet your requirements.

Offline Kryzon

  • Jr. Member
  • **
  • Posts: 27
Re: Writing a program to sync music files
« Reply #8 on: October 24, 2017, 04:18:33 AM »
Thanks GW, I'll take a look.