FORUMS
Remove All Ads from XDA

adbsync.exe - Win32 command line syncer

2,453 posts
Thanks Meter: 1,143
 
By Renate NST, Inactive Recognized Developer / Recognized Contributor on 4th February 2013, 08:15 PM
Post Reply Email Thread
17th September 2013, 03:06 AM |#21  
Renate NST's Avatar
OP Inactive Recognized Developer / Recognized Contributor
Boston
Thanks Meter: 1,143
 
More
Well, how about this?

I cleaned up the code so that it will indicate directories that are not matched.
It still won't poke its nose down directories when it need not.

Code:
E:\Handy\New>adbsync /ld /v E:\Handy\ mnt/sdcard/DCIM/Camera

H                2013-09-17 00:53  Bogus
H             9  2013-09-17 01:43  Goodbye
H             7  2013-09-17 01:43  Hello

H   Host dir only               1
    Files match                68
H   Host file only              2
/l (with nothing) will list everything, in this case 71 lines.
Download in the signature.
The Following User Says Thank You to Renate NST For This Useful Post: [ View ] Gift Renate NST Ad-Free
 
 
18th September 2013, 03:55 AM |#22  
osm0sis's Avatar
Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 30,210
 
Donate to Me
More
Works absolutely perfectly! Thank you so much for your efforts!

I'm selecting out the host only files and removing them with a batch script now :
Code:
echo Removing old files . . .
type backup.log | bin\grep -E ^H" " | bin\cut -c 36- | bin\cut --delimiter=+ --fields=1 > host.log
echo ..\host.log >> host.log
for /f "delims=" %%f in ('type host.log') do @bin\rm -R "sdcard/%%f"
echo.

echo Cleaning up empty directories . . .
for /f "delims=" %%d in ('dir /s /b /ad ^| sort /r') do @rd "%%d" > nul 2>&1
echo.
Would it be alright if I put out a zip of my batch automation for your utility? It's got a customizable mountPoint, ignorePattern and onlyPattern variables, as well as a parsed ini file for long paths/filenames to ignore and zip up instead of having adbsync try to pull the files and halt.

Edit: Renate NST gave permission via PM so ADBsync sdcard Backup v1.0 is now available in my Odds and Ends thread, if anyone is interested in a one-click automated backup solution.
8th January 2014, 06:17 AM |#23  
Senior Member
Thanks Meter: 213
 
More
thanks so much for this. I wound up in a situation where I had no recent backups, couldn't get the gui to load, couldn't get my sdcard to mount - but had ADB available. Flashing a ROM was failing to get farther than that, so to have any chance I was going to have to nuke the device.

I was able to use adbsync to pull a lot of /data/data with great success. (I really only needed the information a single app was keeping but it's nice to have been able to pull so much more in case I think 'ooh! but...!' in a few weeks.)

and lo - a complete partition wipe and my device reanimated. After which I was able to restore the database for the app that had a few months' data in it, and it worked out fine.
4th June 2014, 09:36 PM |#24  
osm0sis's Avatar
Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 30,210
 
Donate to Me
More
@Renate NST

Hey! Hope things are well. I've been wondering, will adbsync prefer the larger file if one is found on each end with the same timestamp? I'm thinking along the lines of adb/USB issues causing broken transfers and hoping adbsync will replace the partially downloaded files with the complete ones.

Edit: Actually it looks like an interrupted transfer results in a smaller Host file with a newer timestamp. Any way you can think of to accommodate that use case so it can resume and complete the A->H sync?
12th June 2014, 04:23 AM |#25  
Renate NST's Avatar
OP Inactive Recognized Developer / Recognized Contributor
Boston
Thanks Meter: 1,143
 
More
Hmm, with writing to Android devices there could be an issue if the transfer were interrupted.
If the connection were the problem adbsync could be clever enough to retry.
If adbsync were interrupted somehow (^C should not break files) then the knowledge of the interrupted file would be lost.

In the other direction, to the host, adbsync could be changed to write temp files and only delete the old file and rename upon safe completion.

I've never had any of this happen to me.
If it did, I'd just delete the offending file and re-sync.
The Following User Says Thank You to Renate NST For This Useful Post: [ View ] Gift Renate NST Ad-Free
18th June 2014, 03:49 AM |#26  
Member
Flag Manheim, PA
Thanks Meter: 22
 
More
Thanks for this great utility, it works great for me!

Are you planning on incorporating the ability to delete files from the target that were deleted from the source when you're only syncing one way? For example, if I manually delete somefile.foo on my computer and I use the /a flag with adbsync, I want it to delete somefile.foo from my phone as well.
18th June 2014, 01:58 PM |#27  
Renate NST's Avatar
OP Inactive Recognized Developer / Recognized Contributor
Boston
Thanks Meter: 1,143
 
More
Sorry, the adbd daemon on Android devices does not support any mechanism for file deletion in the file sync service.

I'd have to open a separate shell service on adbd to delete files.
I may get around to implementing that.
18th June 2014, 07:20 PM |#28  
Member
Flag Manheim, PA
Thanks Meter: 22
 
More
Quote:
Originally Posted by Renate NST

Sorry, the adbd daemon on Android devices does not support any mechanism for file deletion in the file sync service.

I'd have to open a separate shell service on adbd to delete files.
I may get around to implementing that.

That would be awesome . Right now I'm using the program to sync my music with iTunes and it works really well, but if I delete a song from iTunes I need to manually delete song from my phone. Not a big deal, but it would be a nice feature to automate it.

Also, are you planning on making the software open source at any point?
6th July 2014, 10:37 PM |#29  
osm0sis's Avatar
Recognized Developer / Recognized Contributor
Flag Halifax
Thanks Meter: 30,210
 
Donate to Me
More
Here's an interesting issue. Fails every time it hits this file:

Code:
<-            0  2014-07-05 18:03  0/multirom/roms/LPV79/data/app/sensor_ctl_socket -
Error "No such device or address" from ADB
And again with:
Code:
<-            0  2014-06-30 18:11  0/multirom/roms/LPV79/data/cam_socket1 -
Error "No such device or address" from ADB
Edit: Here's the complete list of what I had to ignore: sensor_ctl_socket;cam_socket*;wpa_ctrl_597-*;ndebugsocket

Anyway just seems like something adbsync might want to detect to prevent failures.
7th July 2014, 01:25 AM |#30  
Senior Member
Flag Las Vegas, NV
Thanks Meter: 231
 
More
I keep getting "heap commit failed" errors. No idea how to pull a log, but I'd be happy to try with some guidance.

Sent from my Galaxy Nexus using Tapatalk
7th July 2014, 07:42 AM |#31  
Renate NST's Avatar
OP Inactive Recognized Developer / Recognized Contributor
Boston
Thanks Meter: 1,143
 
More
Quote:
Originally Posted by osm0sis

Fails every time it hits this file:

Could you do this and paste it?
Code:
# busybox stat nastyfile -c '%f %F'
Quote:
Originally Posted by demlv

I keep getting "heap commit failed" errors.

About how many files are in the tree that you are syncing?
Post Reply Subscribe to Thread

Tags
adb, sync, tool

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes