Git Product home page Git Product logo

Comments (12)

markstock avatar markstock commented on April 23, 2024 6

If you can't wait for a solution, you can just edit the script yourself. Here's how I run adb-sync to retain timestamps for pull actions:

diff --git a/adb-sync b/adb-sync
index 53c37c1..9087f6a 100755
--- a/adb-sync
+++ b/adb-sync
@@ -292,7 +292,7 @@ class AdbFileSystem(object):
 
   def Pull(self, src, dst):
     """Pull a file from the Android device to the local file system."""
-    if subprocess.call(self.adb + [b'pull', src, dst]) != 0:
+    if subprocess.call(self.adb + [b'pull', b'-a', src, dst]) != 0:
       raise OSError('pull failed')

from adb-sync.

kwest12 avatar kwest12 commented on April 23, 2024 1

Has anyone come up with a solution? I am trying to backup my entire sdcard since that isn't backed up with a Nandroid, and then I need to move it all over to my new phone. adp pull -a seems to preserve file attributes (dates) but if I'm understanding correctly, adb push doesn't have an equivalent.

Also, adb seems to take issue with certain filenames and just stop the transfer before its complete. Any advice on that matter is appreciated too (happens when trying to pull /Android/data/)

from adb-sync.

divVerent avatar divVerent commented on April 23, 2024 1

Should be working as far as possible.

from adb-sync.

divVerent avatar divVerent commented on April 23, 2024

Sounds useful. The reason why it's not there is that I couldn't find a way to push to an Android system while preserving timestamps - supporting this one-way only seems to be a bit odd. Still wouldn't be too opposed to it.

For Photos, wouldn't the Gallery app sort by EXIF timestamp though?

from adb-sync.

divico avatar divico commented on April 23, 2024

Your right that there is no adb push command that preserves time stamps. However, it can be easily achieved by pushing a TAR archive with all the files and there timestamps and decompressing it on the device. Most popular ROMs come with TAR pre-installed.

It would be useful to have the -a flag when adb-sync is used in backup scenario. I doesn't need to be adb-sync default though. Having a -a flag in adb-sync possible options would be enough :)

I think that the stock gallery app does not read EXIF but timestamps. At least its my experience on Lineage 14.1 (Android 7.1). Third apps can update the timestamps from the EXIF, buts its annoying and EXIF is not part of the jpeg standard, so it perfectly valid to have jpeg picture without EXIF, which is the case for WhatsApp images for instance.

from adb-sync.

divVerent avatar divVerent commented on April 23, 2024

from adb-sync.

CNG avatar CNG commented on April 23, 2024

In my personal backup strategy (https://github.com/CNG/android-transfer-media/blob/master/adb/run.sh) before I switched to the Rsync/SSH method, I had resorted to using tar to preserve that data. It worked reasonably well but would need to be made robust against running out of free space and transfer issues. For me, the phone randomly disconnected too much and took too long when I had gigabytes of files in the archive to make that approach useful. That's what led me to this repository!

from adb-sync.

divVerent avatar divVerent commented on April 23, 2024

from adb-sync.

kwest12 avatar kwest12 commented on April 23, 2024

So, I'm not nearly advanced enough to understand the method @CNG and @divVerent mentioned (Rsync + SHH?) Is that something that can be run from a Windows computer to sync files the entire sdcard too and from and Android phone? And does it preserve folder structure and file attributes like timestamps and geotags? If so, can someone point me to a (simplistic guide) on how to use it?

@markstock I appreciate whatever you put together there, but I'll be honest, I have very little clue what it does and how to implement it.

I really apologize for coming in with relatively little knowledge on what this stuff is and how to do it. I wish transferring everything off my phone and onto a new one were much easier... When I had to do this in October, I just put a folder at a time into tars, moved them to my computer and then to the new phone, and unpacked them once they were there. I using a relatively full 64GB Nexus 6P, so you can imagine how arduous that process was in order to not exceed the available space (couldn't do it all at once.)

I would really appreciate some help so I don't have to do that again...

from adb-sync.

markstock avatar markstock commented on April 23, 2024

@kwest12 My solution will only preserve time stamps on their way off the phone and onto your computer hard drive. If you then want to move those files onto a new phone, the time stamps will not be retained, and that's a limit of adb (I think).

To use my fix, you'll need adb installed (I'm not sure how to do that on Windows). Then clone this git repository and find the adb-sync file. Open it in a text editor and replace the line indicated by the '-' character with the line indicated by the '+'. Save it and run it. I don't do Windows, so I really don't know how to run Python scripts, but be very careful with the command-line arguments. I always run with the "--dry-run" argument first.

from adb-sync.

kwest12 avatar kwest12 commented on April 23, 2024

I see this issue was closed. Does that mean that adb push now preserves timestamps with the -a flag?

from adb-sync.

divVerent avatar divVerent commented on April 23, 2024

from adb-sync.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.