LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   rsync not seeing file size difference (https://www.linuxquestions.org/questions/linux-software-2/rsync-not-seeing-file-size-difference-4175736821/)

road hazard 05-08-2024 09:59 AM

rsync not seeing file size difference
 
I have a movie on my server and this movie was backed up to the remote server with rsync. (rsync runs daily via cron job)

After a few days, I noticed that the movie I copied over originally didn't have an audio track so I deleted it and copied over the correct version to the main server again. As you can, my main server has the correct version but rsync isn't detecting a difference with this movie so the backup server still has the wrong version. Any idea why rsync isn't seeing the file size difference and triggering a copy? (Looks like it's only matching on file date and is ignoring the size difference.)

Movie on main server:
4689775625 May 4 2024 'Test video at the park 4K HDR (2024).mp4'

Movie on backup server: (that rsync isn't copying over)
3513504381 May 4 2024 'Test video at the park 4K HDR (2024).mp4'

Here's the rsync command I'm using:

Code:

rsync -h --progress --stats -r -tgo -p -l -D --update --delete-after --delete-excluded --exclude=**/*tmp*/ --exclude=**/*cache*/ --exclude=**/*Cache*/ --exclude=**~ --exclude=/mnt/*/** --exclude=/media/*/** --exclude=**/lost+found*/ --exclude=/var/run/** --exclude=/run/** --exclude=/proc/** --exclude=/dev/** --exclude=/sys/** --exclude=**/*Trash*/ --exclude=**/*trash*/ --exclude=**/.gvfs/ --exclude=./ --protect-args /mnt/md0/ roadhazard@remote_backup_server.com:/mnt/backup/md0/

Petri Kaukasoina 05-08-2024 10:24 AM

Which file is newer? Check with command stat. You used --update (skip files that are newer on the receiver).

wpeckham 05-08-2024 10:59 AM

That stat output might be informative.
Is the block size or file system format different on the two devices (local and remote)? Is rsync using crc for difference detection?

pan64 05-08-2024 11:13 AM

probably this helps: https://superuser.com/questions/1624...ferent-content

road hazard 05-08-2024 01:36 PM

Quote:

Originally Posted by Petri Kaukasoina (Post 6500517)
Which file is newer? Check with command stat. You used --update (skip files that are newer on the receiver).

That was the solution, thank you!

No idea how a newer version of that file ended up on the backup server since files are only copied via rsync but....

File on main server:

Code:

Access: 2024-05-07 02:12:08.300077984 -0400
Modify: 2017-08-04 00:48:04.000000000 -0400
Change: 2024-04-30 20:00:01.984863105 -0400
Birth:  2024-04-30 19:14:26.991827051 -0400



File on backup server:

Code:

Access: 2024-05-08 10:08:52.429705278 -0400
Modify: 2017-08-04 07:03:47.004843600 -0400
Change: 2024-04-30 00:43:44.632281020 -0400
Birth:  2024-04-30 00:26:37.648042138 -0400


road hazard 05-08-2024 01:40 PM

Quote:

Originally Posted by wpeckham (Post 6500523)
That stat output might be informative.
Is the block size or file system format different on the two devices (local and remote)? Is rsync using crc for difference detection?

Yep, the stat command from Petri Kaukasoina solved the mystery. I modified the rsync command line and the file was finally copied over.

wpeckham 05-08-2024 07:19 PM

Good! Glad for you!


All times are GMT -5. The time now is 05:39 PM.