Comments (12)
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.
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.
Should be working as far as possible.
from adb-sync.
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.
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.
from adb-sync.
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.
from adb-sync.
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.
@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.
I see this issue was closed. Does that mean that adb push now preserves timestamps with the -a flag?
from adb-sync.
from adb-sync.
Related Issues (20)
- error running it. stacktrace. HOT 1
- Colon not supported in folder name HOT 8
- Hard-coded location of python3 HOT 2
- TypeError with latest rev HOT 1
- Problems with parameters: a bytes-like object is required, not 'str' HOT 3
- adb-sync seems to close standard input? HOT 3
- anyway to --reverse and --delete?
- Problems with encoding: UnicodeDecodeError: 'utf-8' codec can't decode byte: invalid start byte HOT 6
- Is this project still active? HOT 2
- windows 10 HOT 8
- adb-sync doesn't work correctly with symlinks
- Crashes when trying to copy files with question marks in the name.
- Copying from external storage HOT 4
- adb-sync doesn't copy files properly if names are same on local and remote HOT 5
- When the file length is the same, it will be considered as no difference HOT 1
- two way sync breaks when filename contains spaces
- Scanning and diffing takes a long time for large directories HOT 2
- "bad date" from "touch" when using -t option HOT 1
- Ignore unreadable files
- Use my fork HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adb-sync.