LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-08-2024, 09:59 AM   #1
road hazard
Member
 
Registered: Nov 2015
Posts: 257

Rep: Reputation: Disabled
Question 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/
 
Old 05-08-2024, 10:24 AM   #2
Petri Kaukasoina
Senior Member
 
Registered: Mar 2007
Posts: 1,849

Rep: Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520Reputation: 1520
Which file is newer? Check with command stat. You used --update (skip files that are newer on the receiver).
 
2 members found this post helpful.
Old 05-08-2024, 10:59 AM   #3
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 5,712

Rep: Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720
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?

Last edited by wpeckham; 05-08-2024 at 11:05 AM.
 
Old 05-08-2024, 11:13 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,976

Rep: Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337
probably this helps: https://superuser.com/questions/1624...ferent-content
 
Old 05-08-2024, 01:36 PM   #5
road hazard
Member
 
Registered: Nov 2015
Posts: 257

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Petri Kaukasoina View Post
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
 
Old 05-08-2024, 01:40 PM   #6
road hazard
Member
 
Registered: Nov 2015
Posts: 257

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by wpeckham View Post
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.
 
Old 05-08-2024, 07:19 PM   #7
wpeckham
LQ Guru
 
Registered: Apr 2010
Location: Continental USA
Distribution: Debian, Ubuntu, RedHat, DSL, Puppy, CentOS, Knoppix, Mint-DE, Sparky, VSIDO, tinycore, Q4OS, Manjaro
Posts: 5,712

Rep: Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720Reputation: 2720
Good! Glad for you!
 
  


Reply

Tags
rsync



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Partition size and filesystem size difference Tsyvatsok Linux - Software 8 05-22-2020 03:57 PM
Linux Virtual Memory size; Page size; Resident Data Size; DB2Database; Explanation ANanalanalyzer Linux - Newbie 1 09-28-2018 04:50 PM
shell script to find the difference betwwn two file and place the difference to other kittunot4u Linux - General 3 07-19-2010 04:26 AM
Difference in the RAM's size and the size of the image of RAM (taken via dd), Why? Usmanaj Linux - Newbie 2 08-01-2009 12:17 AM
Total partition size - User partition size is not equals to Free partition size navaneethanj Linux - General 5 06-14-2004 12:55 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration