Rockbox Technical Forums

Rockbox General => Rockbox General Discussion => Topic started by: Dorkmaster Flek on September 01, 2008, 04:28:51 PM

Title: Question about updating database on 30 GB iPod Video
Post by: Dorkmaster Flek on September 01, 2008, 04:28:51 PM
I have a 5th gen iPod and Rockbox is working great, but there's a small issue that's nagging me when syncing up my music library.  I'm just using rsync to sync my music folder to my iPod when I make any changes and I'm doing it based on timestamp so it only transfers the modified/new files.  This works fine, and after I eject and boot back up, I update the database.  Now the next time I plug it back in to my PC to sync, some files in any new folders that I transfered (it seems random) will have slightly different timestamps, which causes rsync to think they've changed and transfer them again when I just want only the few files I may have updated.  I can get around this by doing an rsync the other direction, from the iPod to my music folder, after the transfer and database update, but it's annoying and I'm not sure why it's happening.  Does Rockbox modify the timestamp on the files for some reason when updating the database?  Should I just not use the database feature for now?  Thanks.
Title: Re: Question about updating database on 30 GB iPod Video
Post by: Llorean on September 01, 2008, 10:57:27 PM
Are the timestamps less than 2 seconds different?

Have you tried checking if they seem to be different without updating the database?
Title: Re: Question about updating database on 30 GB iPod Video
Post by: Dorkmaster Flek on September 03, 2008, 10:49:22 PM
Yes and yes to both your questions!  The files which are different (only some are) have a timestamp of 1 second earlier than on my PC!  They are like this as soon as I transfer them over, without updating the database.  It sounds like you may have some insight into this problem, I hope?  :D
Title: Re: Question about updating database on 30 GB iPod Video
Post by: Llorean on September 03, 2008, 11:05:56 PM
I believe it's just a filesystem thing. FAT32 has, if I recall correctly, a 2 second timestamp granularity. So it's really that simple. I'm sure there are people who use rsync between FAT32 and filesystems with better granularity, so maybe you can find some solutions through Google that are from unrelated but very similar situations.
Title: Re: Question about updating database on 30 GB iPod Video
Post by: Dorkmaster Flek on September 04, 2008, 09:27:47 AM
Ah, there's my answer.  Well you learn something new every day.  :)  Just for reference for anyone reading, I did a quick search and found that rsync has a --modify-window option which specifies the window in seconds for comparing timestamps for it to be considered equal.  By default, this is 0.  However with FAT32s 2 second granularity, setting this to 1 (or 2 just to be safe) eliminates the problem.  I love how *NIX has so many useful little utilities.  Thanks a bunch!  :D