Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have some programs that allow exporting to different formats (e.g. html), but many of them share a problem: Exports are always done "all together", i.e. things like images or attachments are created new in the export folder on every export, even if they have not changed since last exporting. Also, usually they don't take care of removing deprecated files or may even fail when the directory already contains files. I've seen similiar problems with the export functionalities of different programs, currently my use-case is ZIM Desktop Wiki.

I thought I could just export to a temporary directory and then use rsync to synchronize the exported file to the final export directory, e.g. Google Drive or Dropbox. Using rsync however, I couldn't find a way to integrate the changed files into the target directory without changing the modification times of files that did NOT actually change, which is likely to confuse either backups of the directory and/or the cloud synchronization, causing unnecessary upload traffic in one case, duplicate files on the drive with the incremental backups in the other and a huge waste of time in both.

Is there some way to make rsync do a check by actual file contents and leave meta-data alone for files that are the same, or some existing solution other than rsync?

share|improve this question
add comment

1 Answer

From the rsync man page:

-c, --checksum : skip based on checksum, not mod-time & size

share|improve this answer
    
Doesn't preserve the modtime of unchanged files, so it is still likely to confuse other software. –  kdb Aug 5 '13 at 11:53
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.