I have a script that mounts a Veracrypt container in my external HD, Rsync files into it and then dismount the container.

Problem is that if I run it twice in a row, or some time later, for some reason all my files are copied again, like if the destination files were all modified after the first run.

Not sure if this is an issue with my Rsync line or VeraCrypt itself. Does VeraCrypt maybe change the files inside the container when you mount and dismount it and that's why Rsync thinks they're modified?

Here's an example of the script I'm using with dummy data:

# Dismount all existing containers
veracrypt -d

# Mount container
veracrypt -t --mount /media/${USER}/HD/vault /media/${USER}/veracrypt -p test --non-interactive

# Sync files
rsync -vhr --progress --delete ~/Downloads/WoW/ /media/${USER}/veracrypt/WoW/

# Dismount
veracrypt -d

Found the problem ... I need to specify option-t (-u also helps in my case):

-u, --update                skip files that are newer on the receiver
-t, --times                 preserve modification times

Now it does not sync all files every time I run it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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