Rsync is copying files that have not changed

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
linux_trojan
Level 3
Level 3
Posts: 120
Joined: Fri Apr 12, 2013 4:43 pm

Rsync is copying files that have not changed

Post by linux_trojan »

This is the command I am using

rsync -avu --delete /source /destinatoin

I only want to update files that have changed and new files and delete non existing files. Yet, everything is getting copied. Takes 5 days.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Moonstone Man
Level 16
Level 16
Posts: 6054
Joined: Mon Aug 27, 2012 10:17 pm

Re: Rsync is copying files that have not changed

Post by Moonstone Man »

linux_trojan wrote: Sun Jun 20, 2021 11:18 pm This is the command I am using

rsync -avu --delete /source /destinatoin

I only want to update files that have changed and new files and delete non existing files. Yet, everything is getting copied.
That will happen unless both source and destination are mounted on their respective hosts with the noatime option in fstab.
linux_trojan
Level 3
Level 3
Posts: 120
Joined: Fri Apr 12, 2013 4:43 pm

Re: Rsync is copying files that have not changed

Post by linux_trojan »

Help me out here. I am not sure what this means.

Source is on my computer. Destination is a network drive that I have mounted, actually on /mnt but as user not root. I have to change the fstab for Source? Its actually two drives in source /dev/sda has /home and sdb is mounted on /home/user/movies
linux_trojan
Level 3
Level 3
Posts: 120
Joined: Fri Apr 12, 2013 4:43 pm

Re: Rsync is copying files that have not changed

Post by linux_trojan »

is this what you mean?

in fstab go to my partitions and insert defaults,noatime
then mount //network drive /linux folder -o noatime
Last edited by linux_trojan on Sun Jun 20, 2021 11:48 pm, edited 1 time in total.
Moonstone Man
Level 16
Level 16
Posts: 6054
Joined: Mon Aug 27, 2012 10:17 pm

Re: Rsync is copying files that have not changed

Post by Moonstone Man »

linux_trojan wrote: Sun Jun 20, 2021 11:36 pm Help me out here. I am not sure what this means.
https://wiki.archlinux.org/title/Fstab
The noatime option fully disables writing file access times to the drive every time you read a file...
linux_trojan
Level 3
Level 3
Posts: 120
Joined: Fri Apr 12, 2013 4:43 pm

Re: Rsync is copying files that have not changed

Post by linux_trojan »

Can you check out my plan for doing this on the previous post? Am I reading you correctly?
linux_trojan
Level 3
Level 3
Posts: 120
Joined: Fri Apr 12, 2013 4:43 pm

Re: Rsync is copying files that have not changed

Post by linux_trojan »

I was able to get the fstab setup I did $sudo mount -a to get it all remounted. I wasnt able to do the sudo mount with -o noatime for the network drive. I get an error.

I have never had this problem before until recently. I think Mint used to come with noatime in fstab by default. Any ways, rsync now is pretty much picking up where it left off last time, which is an improvement. Normally it would just start all over again.
mikeflan
Level 17
Level 17
Posts: 7152
Joined: Sun Apr 26, 2020 9:28 am
Location: Houston, TX

Re: Rsync is copying files that have not changed

Post by mikeflan »

I have never had this problem before until recently. I think Mint used to come with noatime in fstab by default.
I'd like to hear more about what changed on the linux_trojan computer. Different OS installed, or perhaps an update??
linux_trojan
Level 3
Level 3
Posts: 120
Joined: Fri Apr 12, 2013 4:43 pm

Re: Rsync is copying files that have not changed

Post by linux_trojan »

I recently reformatted the drive and reinstalled everything, got everything that I had backed up previously. I was using MX Linux but started having problems. Turns out my HD was all chopped up with partitions that I did not even recognize. So, just stared all over. Repartition, reformat, reinstall, reload /home/user data.
Aztaroth
Level 5
Level 5
Posts: 764
Joined: Mon Jan 11, 2021 1:48 am

Re: Rsync is copying files that have not changed

Post by Aztaroth »

linux_trojan wrote: Sun Jun 20, 2021 11:18 pm This is the command I am using

rsync -avu --delete /source /destinatoin

I only want to update files that have changed and new files and delete non existing files. Yet, everything is getting copied. Takes 5 days.
Can you give exact syntax of the command you used ? rsync won't have the same behavior depending on an '/' at the end of source or not :

Code: Select all

rsync -avu --delete /linux/trojan/source /linux/trojan/dest
and

Code: Select all

rsync -avu --delete /linux/trojan/source/ /linux/trojan/dest
are completely different :
See 3 of the 3888 :D lines of man rsync
A trailing slash on the source changes this behavior to avoid creating an additional directory level
at the destination. You can think of a trailing / on a source as meaning "copy the contents of this
directory" as opposed to "copy the directory by name".
Also, use -n option (dry-run) to simulate the sync before doing it when you're not sure. It will let you know if your expectancy is matched or not (especially last lines of statistics - if your initial guess is "there are 3 or 4 text files to sync" and the statistics show a 2TB data transfer, something's wrong in your command)

Code: Select all

rsync -avu --delete /linux/trojan/source/ /linux/trojan/dest -n
and suppress it when you're satisfied with your command line.
dual boot LMDE4 (mostly) + LM19.3 Cinnamon (sometimes)
Locked

Return to “Software & Applications”