yashsingh1/xdaforums huggingface dataset:
[Nook Touch General] Renate:
We're beyond this.

It has nothing to do directly with adbsync.exe or even any of the Android ADB.

My Kyocera Rise has:

shell@android:/ $ mount
mount
[i]lots of stuff[/i]
/dev/block/vold/179:33 /mnt/sdcard vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015,fm
ask=0702,dmask=0702,[b]allow_utime=0020[/b],codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
/dev/block/vold/179:33 /mnt/secure/asec vfat rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=10
15,fmask=0702,dmask=0702,[b]allow_utime=0020[/b],codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0
[i]more stuff[/i]

What does yours say?

mount
[Nook Touch General] pbelcl:
shell@android:/ $ mount
mount
rootfs / rootfs ro,relatime 0 0
tmpfs /dev tmpfs rw,nosuid,relatime,mode=755 0 0
devpts /dev/pts devpts rw,relatime,mode=600 0 0
proc /proc proc rw,relatime 0 0
sysfs /sys sysfs rw,relatime 0 0
debugfs /sys/kernel/debug debugfs rw,relatime 0 0
none /acct cgroup rw,relatime,cpuacct 0 0
tmpfs /mnt/secure tmpfs rw,relatime,mode=700 0 0
tmpfs /mnt/asec tmpfs rw,relatime,mode=755,gid=1000 0 0
tmpfs /mnt/obb tmpfs rw,relatime,mode=755,gid=1000 0 0
none /dev/cpuctl cgroup rw,relatime,cpu 0 0
/dev/block/platform/msm_sdcc.1/by-name/system /system ext4 ro,relatime,data=orde
red 0 0
/dev/block/platform/msm_sdcc.1/by-name/cache /cache ext4 rw,nosuid,nodev,noatime
,data=ordered 0 0
/dev/block/platform/msm_sdcc.1/by-name/userdata /data ext4 rw,nosuid,nodev,noati
me,noauto_da_alloc,data=ordered 0 0
/dev/block/platform/msm_sdcc.1/by-name/persist /persist ext4 rw,nosuid,nodev,rel
atime,nodelalloc,data=ordered 0 0
/dev/block/platform/msm_sdcc.1/by-name/modem /firmware vfat ro,relatime,uid=1000
,gid=1000,fmask=0337,dmask=0227,codepage=cp437,iocharset=iso8859-1,shortname=mix
ed,errors=remount-ro 0 0
/dev/fuse /mnt/shell/emulated fuse rw,nosuid,nodev,relatime,user_id=1023,group_i
d=1023,default_permissions,allow_other 0 0
/dev/block/dm-2 /mnt/asec/com.noinnion.android.greader.readerpro-1 ext4 ro,dirsy
nc,nosuid,nodev,noatime 0 0
/dev/block/dm-4 /mnt/asec/com.keramidas.TitaniumBackupPro-2 ext4 ro,dirsync,nosu
id,nodev,noatime 0 0
/dev/block/dm-1 /mnt/asec/com.levelup.beautifulwidgets-1 ext4 ro,dirsync,nosuid,
nodev,noatime 0 0
/dev/block/dm-6 /mnt/asec/com.widgapp.NFC_ReTAG_PRO-1 ext4 ro,dirsync,nosuid,nod
ev,noatime 0 0
/dev/block/dm-0 /mnt/asec/com.quoord.tapatalkpro.activity-1 ext4 ro,dirsync,nosu
id,nodev,noatime 0 0
/dev/block/dm-5 /mnt/asec/com.shazam.encore.android-2 ext4 ro,dirsync,nosuid,nod
ev,noatime 0 0
shell@android:/ $
[Nook Touch General] Renate:
Ok, your problem is that you have a Nexus 4 there which does not actually have an external SD card.

It is all emulated through the FUSE filesystem.

There are numerous reports of this not allowing setting of file modification timestamps.

Also, apparently you do not have busybox installed, you can use toolbox.

Try this test, tell me what if anything shows up differently.

Start out running as shell (with the $ prompt):

shell@android:/ $ [b]cd /sdcard[/b]
cd /sdcard
shell@android:/sdcard $ [b]echo Hello > hello.txt[/b]
echo Hello > hello.txt
shell@android:/sdcard $ [b]ls -l hello.txt[/b]
ls -l hello.txt
----rwxr-x system sdcard_rw 6 2013-03-06 09:54 hello.txt
shell@android:/sdcard $ [b]toolbox touch -t 946728000 hello.txt[/b]
toolbox touch -t 946728000 hello.txt
shell@android:/sdcard $ [b]ls -l hello.txt[/b]
ls -l hello.txt
----rwxr-x system sdcard_rw 6 2000-01-01 07:00 hello.txt [color=red]or is it the same date?[/color]
shell@android:/sdcard $ [b]su[/b]
su
shell@android:/mnt/sdcard # [b]toolbox touch -t 946728000 hello.txt[/b]
toolbox touch -t 946728000 hello.txt
shell@android:/mnt/sdcard # [b]ls -l hello.txt[/b]
ls -l hello.txt
----rwxr-x system sdcard_rw 6 2000-01-01 07:00 hello.txt [color=red]and now?[/color]
[Nook Touch General] pbelcl:
after SU it is another date with year 2000, as in your example, means changed correct!!

if you want another test i can try it also with busybox, because i installed this programm for use with tasker!
[Nook Touch General] Renate:
Thanks.

No, toolbox or busybox, it's all the same.

As suspected, you'll have to get ADB running as root to make it put in the timestamps.

This requires that you change default.prop to ro.secure=0

You could also modify adbd to ignore ro.secure.

In either case this is a question of flashing a modified ROM onto your Nexus 4.
[Nook Touch General] pbelcl:
how can i make this?

is this a file on my device i have to change?

if this is only possible when flashing a modified rom, then i let this go...

my nexus runs perfekt an i dont want to "modify" anythong for now....
[Nook Touch General] Renate:
ro.secure is usually in default.prop which is wrapped up in the ramdisk or your system image.

adbd could be wrapped up in the ramdisk or in another filesystem.

Sorry, this is a question for the Nexus 4 forums.
[Nook Touch General] ApokrifX:
Ouch!

Renate, I'm supposed to be your thread hijacker, not you, right? :o

I short, ro.secure=0 is not sufficient (and we did discuss it already), you need you use right adbd.

You can pull one from here: http://xdaforums.com/showthread.php?t=1687590
[Nook Touch General] Renate:
@ApokrifX From the author of the patch that you cite:

In any case, if adbd is started in init.rc without a user line (i.e. as root)

and ro.secure=0 or adbd is patched to ignore it, then adbd will be root.

The source code for adbd makes it clear what's what.

Yes, on devices later than our Nook to get one of these things modified can be tricky.
[Nook Touch General] ApokrifX:
Don't know exactly.

On BlueStack I've set ro.secure=0, but were not able to get adbd root still.

So it's might be something else as well.

The bottom line (for everyone, except Renate ;)) - either use apk to patch adbd "on demand".

Or pull patched adbd (you version) from APK and use it.

Whatever is easier...
[Nook Touch General] Renate:
Well, you goaded me into looking at BlueStacks.

It certainly makes the off-the-shelf Android emulator look cheesy.

Still, I would never be convinced of anything by telling me what an emulator does.

I haven't bothered to root it to see what's going on.

How does it start adbd in init.rc? Does it actually use init.rc or is that window dressing?

In any case, adbd is an ELF native file, you don't use apktool to mod it.

As stated above, my mod was just to change ro.secure to persist.z

Can we get back on topic now? :D

I hope all you FAT-heads enjoyed springing into Daylight Savings Time.

All your files on vfat should have changed filetimes by an hour.

My 6000 files on ext3 peacefully slept through the clock change.
[Nook Touch General] ApokrifX:
Finally! :)

Did you notice – it has ALSA too.

I don’t remember now, I’ll take a look and let you know.

Naturally, APK has few modded versions of "adbd ELF native file" for different Android OSs. No idea, why did you mention apktool at all? :o

Yep. I do remember perfectly.

That’s why pbelcl didn’t show up yet. He has a lot to sync! ;)
[Nook Touch General] pbelcl:
I am here, I am overwhelmed with your discussion.

If you have a solution that I can implement as a beginner, then let me know ;)
[Nook Touch General] ApokrifX:
Install adbd-Insecure-v1.20.apk from http://xdaforums.com/showthread.php?t=1687590

Enable adbd insecure - you'll get adbd running as root

Proceed as usual.

---------- Post added at 02:22 PM ---------- Previous post was at 02:17 PM ----------

With these setting, adbd don't run as root on BlueStack

Here we go:

shell@GT-N7000:/ # getprop ro.secure

0

default.prop

------------

#

# ADDITIONAL_DEFAULT_PROPERTIES

#

ro.secure=0

ro.allow.mock.location=1

ro.debuggable=1

persist.service.adb.enable=1

init.rc

-------

on property:ro.secure=0

start console

# adbd is controlled by the persist.service.adb.enable system property

service adbd /sbin/adbd

# disabled

# adbd on at boot in emulator

#on property:ro.kernel.qemu=1

# start adbd

#on property:persist.service.adb.enable=1

# start adbd

#on property:persist.service.adb.enable=0

# stop adbd

ps : grep adb

USER PID PPID VSIZE RSS WCHAN PC NAME

shell 1362 1 3508 244 ffffffff 08053214 S /sbin/adbd
[Nook Touch General] osm0sis:
Something about: adbsync /hscu /s /ld /v ".\backup\sdcard\" "/data/media/" /i*catalog*

creates a /data/ folder on the root my C drive. Only certain files seem to get funneled there. :confused:
[Nook Touch General] pbelcl:
I have some news to tell!

my HTC One X syncs well and the file date is no problem since using

Rom from Android Revolution!.

Did so on my Nexus4 , but nothing changed!

Nexus still says that files on Adroid is newer. even when adbd-Insecure-v1.20.apk is activated...
[Nook Touch General] ApokrifX:
For Nexus4 - when you do adb shell - do you get root (#) prompt right away, without typing su?

It's should be by default too for Android Revolution ROM, without adbd-Insecure.
[Nook Touch General] Renate:
Hmm, that sounds bizarre. I can't replicate it.

There's no need to do ".\backup\sdcard\", it's the same as "backup\sdcard".

Better yet, make sure and put in a full path.

If you are in doubt where it's starting out, you could type something like "ZZZZ"

and it might say "The root E:\Trains\Planes\Subways\ZZZZ does not exits".
[Nook Touch General] osm0sis:
I'll try it without the .\ to see if that's what's somehow confusing it. Failing that full path it is. Thanks. :)

Edit: Yup! Removing the .\ seems to have resolved it. :good:
[Nook Touch General] pbelcl:
NO the prompt lookes "shell@android:/ $"

does that mean my root is not OK??

i tested it with tianium backup and the backup works perfect..

Thats right, on the OneX i have: "root@android:/ #" without adbd-insecure!
[Nook Touch General] ApokrifX:
We talk neither about root nor titanium backup, but how to make adbd run as root.

And adbd doesn't run as root in this case.

Exactly. Why would you need adbd-insecure with custom ROM?

I assume, you have adbd-insecure topic already and know what it does, right?
[Nook Touch General] pbelcl:
i know!!

the question i cant find an ansewer is why does adbsync not change filedate on my rooted nexus.

or better: why does adb not run as root on teh rooted device ...
[Nook Touch General] ApokrifX:
It's not supposed too, unless you do something about it.

If you do use adbd-insecure AND it didn't work as expected, you need to ask for help in adbd-insecure topic, not here. :o
[Nook Touch General] osm0sis:
Are you adb shelling in when you're booted to custom recovery like CWM or TWRP? Or are you doing this from USB Debugging booted to Android? USB Debugging adb shell never starts as root. Either way, your question is better suited to the Q&A section for your device, not here.
[Nook Touch General] ApokrifX:
Right! I was official hijacker of this thread, until Renate took it from me.

Although, she cannot be hijacker of her own thread, can she? I'm lost already... :o
[Nook Touch General] mejack03:
From OP

Sync both directions including subdirectories

adbsync C:\Stuff sdcard/Stuff /a /h /s /v

I tried to sync entire sdcard with my pc folder using the below command

adbsync c:\Backup\Nexus sdcard /a /h /s /v

but i am getting a error sdcard is not a directory.

it worked when i tried with a particular folder inside a sdcard

adbsync c:\Backup\Nexus\Songs sdcard/Songs /a /h /s /v

Pls help me to sync entire sdcard with my PC!. Thanks
[Nook Touch General] osm0sis:
The OP isn't correct anymore. The switches have changed a few times since then. Read through and you'll find the info you need. :)
[Nook Touch General] Renate:
That's probably because /sdcard is not a directory. :D

It's probably a symbolic link, a/k/a symlink.

A quick check:

ls -l /

If you see an arrow thingie, then it is. Use the target of the symlink.

That could be /mnt/sdcard or /storage/sdcard0 or something else.

Note: To clarify, mejack03 is not asking about a Nook.

Good morning, osm0sis. Up early? ;)
[Nook Touch General] DeanGibson:
Delete?

I didn't see it mentioned (or perhaps I missed it), but does adbsync delete files on the target that don't exist on the source? Like "rsync --delete".
[Nook Touch General] Renate:
No. The Android file sync service used by adbd does not support any deletion.

You'd have to use the shell service in adbd, kind of a hack and annoying to switch in and out of.
[Nook Touch General] mejack03:
@rena

Thanks.. i tried with ls -l.. and it shows

lrwxrwxrwx root root 2013-03-17 15:18 sdcard -> /storage/emulated/legacy

Then, i tried with

adbsync.exe c:\backup\Nexus storage/emulated/legacy /a /h /s /v

and i am getting a error The root "/storage/emulated/legacy" is not a directory
[Nook Touch General] Renate:
So...

ls -l /storage/emulated
[Nook Touch General] DeanGibson:
adbsync vs. rsync

That's too bad. I agree about not using the shell.

Every 28 days I transfer about 40,000 PDF files (10+GB) from my PC to several tablets. Most of the files are new, but about 10% are not. Presently I just delete everything on the target and then transfer all new content using "adb push" on Android 3.0+ devices, since MTP is such a crock of $#|!.

Obviously, an "rsync --delete" type option would be useful. I tried using rsync, but my Linux rsync is so much older than my Android rsync, that it didn't work. Someday soon I will upgrade my CentOS 4.4 systems ...
[Nook Touch General] Renate:
One solution is to extend the file sync protocol used by adbd to include delete.

The good thing is that you wouldn't need to change the host server part of things.

You'd somewhat lose the main plus of ADB, its ubiquitousness.

You might be able to have it all resilient enough to handle both stock and extended ABD.
[Nook Touch General] osm0sis:
Looks like updates have switched over to the Android Development & Hacking section:

http://xdaforums.com/showthread.php?t=2133312

New version was out on July 18, 2013! :D

P.S. As such, we should likely move future conversation from this thread to that one; I'm going to Unsubscribe to this one. :good:
[Nook Touch General] morgacb:
Absolutely brilliant! I stumbled on this post looking for a sync solution for my HTC One, as the ADB Pull command was unnecessarily taxing (continuously pulling and overwriting the same files).

Used your lovely application to build a BAT file to backup the primary folders on my phone, the User Applications folder (/data/app),the System Apps folder (/system/app), and the internal storage (/storage/sdcard0/". The best part; I have a Task scheduled on my PC to run this file on a weekly basis! Totally achieves the goal of having a persistent backup of my data and applications.

[MENTION=279333]ECHO[/MENTION] OFF
adb devices
CLS
TIMEOUT 5 [MENTION=279333]ECHO[/MENTION] Synchronizing Internal Storage
adbsync /hscu /au /d:/s /q "C:\01 Morgan\Dropbox!\Apps\HTC Backup\Manual Backup\Storage" "/storage/sdcard0/"
CLS [MENTION=279333]ECHO[/MENTION] Internal Storage Synchronized to Dropbox!
TIMEOUT 5 [MENTION=279333]ECHO[/MENTION] Synchronizing User Applications
adbsync /hscu /au /d: /s /q "C:\01 Morgan\Dropbox!\Apps\HTC Backup\Manual Backup\USERAPPS" "/data/app"
CLS [MENTION=279333]ECHO[/MENTION] Internal Storage Synchronized to Dropbox! [MENTION=279333]ECHO[/MENTION] User Applications Synchronized to Dropbox!
TIMEOUT 5 [MENTION=279333]ECHO[/MENTION] Synchronizing System Applications
adbsync /hscu /au /d:/s /q "C:\01 Morgan\Dropbox!\Apps\HTC Backup\Manual Backup\SYSTEMAPPS" "/system/app"
CLS [MENTION=279333]ECHO[/MENTION] Internal Storage Synchronized to Dropbox! [MENTION=279333]ECHO[/MENTION] User Applications Synchronized to Dropbox! [MENTION=279333]ECHO[/MENTION] System Applications Synchronized to Dropbox! [MENTION=279333]ECHO[/MENTION] Synchronization Complete for:
adb devices
adb kill-server
TIMEOUT 5
exit
[Nook Touch General] osm0sis:
Similar to my batch script :):

http://xdaforums.com/showpost.php?p=37722970

Except I just assume I've made a CWM backup so all I need to sync is the sdcard, since that'll pull the CWM backup too. The result is a snapshot of my entire device. :good:

Anyway, I think we'd be better off moving discussion to the new adbsync thread from now on. ;)
[Nook Touch General] nicesoni_ash:
I added a line as this..

/data/media/0/Android/

in longfilenames-ignore-list and started my sd card backup. All went well except this same directory. I wanted to ignore all long names files and in the end compiled them all in a single zip archive but in the end, I got this error as shown in attachment, other than that all files were backed up properly..

Any suggestions?
[Nook Touch General] vectorgate:
Thanks Renate

we just wanted to share our appreciation to your work. We've used adbsync utility with our game development and it's almost brilliant. The ability to upload only some changes (not whole build) speeded our development drastically.

I have only one minor thing to consider

- when copying to sd card (and also possibly to internal memory - i haven't tested - i don't use root) the time of the file is changed to time of upload.

- It would be nice to have file time (create/update) preserved.

This issue doesn't bother when you just upload files. But when you want whole dicectory synchronization - it always downloads/uploads whole directory structure.

So thanks again, even with this little discomfort the utility is GREAT!

Petr Sovis (Vector Gate) .
[Nook Touch General] Renate:
There are two threads here and a lot of posts, so I'll summarize.

The problem is not adbsync.exe or even adb.

The FUSE filesystems exists in newer Androids to create virtual SD cards or add per-user virtual SD cards on real SD cards.

There is the anomalous situation that a user can write a file but not change the timestamps.

When uploading, adb will write a file, close it, then change the write timestamp using the info received over adb.

It uses utime().

FUSE will not allow a user to do that, only root.

The adbdaemon, adbd, usually is started in root.

It then checks ro.secure and demotes itself from root.

If adbd stays root it will work correctly.

The solution is to change to ro.secure=0 or use an insecure adb.

One simple solution is to change in the binary adbd file "ro.secure" to "z.persist".

You could also compile your own adbd from source and not demote from root.
[Nook Touch General] vectorgate:
Ok, that explains. But will need root(at least temporary) in both cases.

Another thing I wanted to ask was about the way you implemented adbsync.

I was looking for a way to implement automatic file transfers from my graphical engine to android device.

1) I downloaded adb sources - THATS huge and I still wasn't able to decrypt transfer protocol (at least not withing hours)

2) I thought about calling adb.exe with commands, but I would need to transfer text response to usefull information - and relay on that "adb shell" won't change its text output.

3) direct sockets - application will listen and act as a server (now the winner)

Is there any other way ? Or can you point me the way you implemented adbsync ?

Thanks!

Petr
[Nook Touch General] Renate:
Here's a chunk of info on ADB.

The selection of device and service uses one protocol.

After that, the individual services use their own protocol.

The file sync service uses its own protocol.
[Nook Touch General] Petr Sovis:
Thanks (again)

you pointed me right way

For others:

https://events.linuxfoundation.org/images/stories/pdf/lf_abs12_kobayashi.pdf

https://android.googlesource.com/platform/system/core/+/gingerbread/adb/SERVICES.TXT

But, as I can see it, i'll stick with your great app :) it has almost no flaws for me and I don't want to spend 3 or more day developing new adb client. But very interesting peek under the hood of adb. I didn't know how it works.

One (last) thing i coudn;t find, just out of curiosity, what if adbd (daemon) is not running. searching the disk (disk/paths/env variables) for adb.exe and calling it with "start-server" doesn't seem to me like a valid option.

Cheers.P
[Nook Touch General] Renate:
adb start-server only starts the server on the host (adb.exe) not the daemon on the Android (adbd).

There is no way to start the daemon, it should always be running.
[Nook Touch General] Petr Sovis:
I meant server(it's called at least on windows version daemon as well) on pc:

adb.exe start-server

* daemon not running. starting it now on port 5037 *

* daemon started successfully *

what to do if server listening on port 5037 is not started, do you handle this situation or just write message server is not running ? Because i'd like to start it automatically but I found only way of doing it so by calling "adb.exe start-server" and that means find adb.exe on disk. (no env variable to adt is defined - again at least not in my ADT version (23 I suppose) ).

Thanks,

Petr
[Nook Touch General] Renate:
Oh, ok, I see what you mean.

No, adbsync never tries to call adb.exe

I guess that it could presume that it's in the path.

I mostly do my syncs from make files

I throw in an adb connect or an adb start-server at the beginning.

If it's running and connected already, no problem
[Nook Touch General] drmalakar:
I got a new adb error /

when try to open adb shell command, it five the following error

- exec ' /system/bin/sh' failed : Not a directory (20) -

Any idea about this error and its rectification.:confused:
[Nook Touch General] Renate:
A shell request over ADB goes to the daemon which is supposed to know where the shell executable is.

It's supposed to be at /system/bin/sh

Is there a file there?

Are the permissions -rwxr-xr-x (755)?

You probably don't have execute permission.
[Nook Touch General] pimpinonline:
This script is pretty nice! I would love it if in later revisions it would delete files on the device that are no longer on the host in the specified directories. It sounds like there isn't a clean way to do this, but hopefully something can be done.

I use this script to sync my music files to my phone, sometimes I will delete songs or albums from my PC, and would prefer those changes were reflected on my device when I sync.
[Nook Touch General] :
Not to put this great utility down, but a great alternative is to use the SwiFTP app, which allows you to start an FTP Server on your Nook and then access it through a URL. Find the .apk down below.
[Nook Touch General] erosco:
File Size

Howdy,

Just found this utility and was trying it out.

Does adbsync compare file sizes or only date/time stamps of files it's comparing? I've had a number of adb 'out of memory' aborts whilst trying to sync a large collection of files and just wondered if some are going to end up 'short' as adb died halfway through a copy?

Thanks

erosco
[Nook Touch General] :
Well, I do know that if your Nook goes into deep_sleep (sleep mode) during a file transfer over ADB, the connection is cut and the rest of the files will end up corrupted and incomplete. I remedy this issue with the free app StayAwake from the Play Store. Check it out - very useful and no battery consumption at all.
[Nook Touch General] erosco:
Thanks for the info - however I have an android tablet I am trying to sync my music with.. Am just wondering if some tracks have been cut short/damaged..
[Nook Touch General] Renate:
Hmm.

How many is a large collection?

Does it work if you use a batch file to divide it into chunks, that is sync your big directories separately.

Is this the latest version of adbsync.exe?

Did you download it directly from my signature?

What does it say exactly?
[Nook Touch General] erosco:
The collection is about 22gig.

I have run the utility many times and it now says all files are sync'd. I just don't know if the files it aborted on transferred ok.

I can start again, but I expect I'll get similar results.

Cheers
[Nook Touch General] jago25_98:
Nookie,

that FTP program looks like a good idea. But I guess the best way to use it is to have it run always... but not use the wakelock option inside that FTP program and instead use StayAlive!, with StayAlive set to only wakelock when charging

?

...but it does seem to crash almost always...

and adbsync isn't recursing subdirectories with /s (and /c) not reognised... this is from renates website version

and next problem is to figure out how to give the nook a hostname so when another network is joined you don't have to find and type in the IP every time