0

I have a 512GB Android phone with 150GB+ 15k+ photos and videos.

Step 1. On my Macbook, I used better-adb-sync with a USB cable and debugging enabled to copy a large amount of files from my phone to my Macbook's disk...DONE

adb-sync -Rdt /sdcard/DCIM/ ~/Documents/phone/AndroidPhone/DCIM

Step 2. Now after a month or two, I want to sync the phone with the disk again for the additional new photos. Now, I don't want to use the cable and turn on the debugging, etc. as the number of files is not much, so I want to use the rsync tool over WiFi with SimpleSSHD.

The problem: On the Macbook terminal, when I run the rsync command below,

rsync --delete -azuvPe 'ssh -p 2222' 192.168.1.3:/sdcard/DCIM/ ~/Documents/phone/AndroidPhone/DCIM

Instead of finding the incremental of new files in the phone quickly and copying them to disk, the output is showing to be copying all the files again which already exist on disk and even the date-time stamps of files are exactly the same.

This syncing is taking hours and hours to complete. This thing, I believe will be happening the first time only and may not happen the 2nd onward incremental backing process from phone to disk.

But I want to know what is happening and why.

I expect rsync to compare and diff the 2 folders and determine initially what new files to copy from the phone to disk and delete from disk what has been deleted from the phone based on size and timestamps (pre-processing), and then simply copy the new incremental extra files even if it is the first time of processing the rsync command.

How can I make this work the above way? Any flags I can pass to ignore some parameters, etc.?

Please Guide.

3
  • I think you should use the same tool each time. Abd test with a folder of files first. Why would you trust it without testing? Commented Sep 25, 2023 at 22:30
  • try solution here// rsync -a --delete <source><destination>
    – beeshyams
    Commented Sep 26, 2023 at 4:38
  • hi @beeshyams i don't have any issues with the command failing. it works fine...but it takes too much of time to diff and shows copying the files which already exist with same size and timestamp. Commented Sep 26, 2023 at 7:03

1 Answer 1

1

Try the --size-only commandline option on the rsync client.

rsync's "quick check" algorithm only updates files if the size or last-modified time (mtime) do not match. For various reasons, the mtime may not be set the first time rsync copies the file (because -t isn't specified, or because OS security policy doesn't allow the mtime to be modified), so the mtime will mismatch even after the file has been freshly copied. --size-only will cause rsync to consider any files with the same size to match. This can cause it to miss some updates but will avoid unnecessary work when the mtimes are not synced.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .