Copy file from computer to Android device — maintain modified date - Android Q&A, Help & Troubleshooting

I'd like to copy some files from my Mac or from a directory in my Dropbox to my rooted Android phone. Easy enough. But I need to maintain the modified dates and times for those files once they're on the phone. I have not found a way to do that. All files copied onto the phone take the time stamp of the moment they were written to the phone. I've tried adb push, file copy from the TWRP file manager, Dropsync, ftp from my computer to the Android phone. Copying files to an external OTG flash drive preserves the time stamps, but when I then copy from the external flash drive to the internal one, the modified time becomes the current one. I've tried an ftp server on the phone that supports MFMT, which I know little about, but am under the impression can preserve time stamps. Nope. The phone doesn't support a micro SD card, so I can't try that.
Any ideas of something that might work?

maigre said:
I'd like to copy some files from my Mac or from a directory in my Dropbox to my rooted Android phone. Easy enough. But I need to maintain the modified dates and times for those files once they're on the phone. I have not found a way to do that. All files copied onto the phone take the time stamp of the moment they were written to the phone. I've tried adb push, file copy from the TWRP file manager, Dropsync, ftp from my computer to the Android phone. Copying files to an external OTG flash drive preserves the time stamps, but when I then copy from the external flash drive to the internal one, the modified time becomes the current one. I've tried an ftp server on the phone that supports MFMT, which I know little about, but am under the impression can preserve time stamps. Nope. The phone doesn't support a micro SD card, so I can't try that.
Any ideas of something that might work?
Click to expand...
Click to collapse
cp -p, midnight commander via ssh is also fine. if you do lot of transfers you should have a look on sshfs.

sub77 said:
cp -p, midnight commander via ssh is also fine. if you do lot of transfers you should have a look on sshfs.
Click to expand...
Click to collapse
I may not be set up to compile sshfs or mc, if that's what it takes. This is not an everyday need I have, though.
From a terminal window on the phone, I was able to use cp -p to copy the files (with the desired time stamps) from the OTG flash drive to the dir where I wanted them on the phone. But the time stamps didn't stick. They wrote as the ones at the time the files were written to the phone. I tried rsync, but the phone says the command isn't there.

Related

Stock 4349 IMG needed

I posted this on the fool proof thread for going from 3588 to 4349. Having troubles and looking for help.
NVFlash confuses me.
I basically just want to install a good 1.2 based ROM and stick with it. Have no intention of going back top 3588.
How do i make it so that if i ever do brick the device or have a need to go back, it just starts as if 4349 is my starting point?
My problems using the foolproof method is that the external SD card i purchased an loaded the necessary files to was not recognized when i followed the choose sdcard/update from sdcard instruction. I am thinking it might be looking for internal SD card as i definitely put the files on it and partioned per intructions...
Anyway, did work or i messed up somehow - looking for alternatives.
Thanks
Okay...I located the file from one of Robeet's threads.
New/additional question to any who view and have know-how/skills:
In his thread he mentions to flash to 4349 DO NOT use CWM. Well, that was teh first thing i did - install CWM.
How do i go about uninstalling?
I also noticed mybe some of my earlier troubles were in that my command file was created in notepad (he warns against file extensions).
Hendge said:
Okay...I located the file from one of Robeet's threads.
New/additional question to any who view and have know-how/skills:
In his thread he mentions to flash to 4349 DO NOT use CWM. Well, that was teh first thing i did - install CWM.
How do i go about uninstalling?
I also noticed mybe some of my earlier troubles were in that my command file was created in notepad (he warns against file extensions).
Click to expand...
Click to collapse
You can still use CWM to flash the stock firmware from teh source he provides. Let me guess, his file is a rar file, when unzipped, you are left with a file called "update.zip" and a folder called "recovery" with a command file in it.
What this is, is the format used to flash something using stock recovery. If you do not have CWM, you'd turn on your tablet, holding +, and it will "see" the recovery file, which will let it know to run the update.zip file.
Since you HAVE CWM, all you need to do is "install zip from SD" and install the update.zip file, just like you would any other rom.
to keep it organized, I suggest you rename it 4349.zip, or stockfirmware.zip, etc.
but yeah, it's completely possible to do it through CWM
as for the "command" file, yes, if it's created in notepad on a windows machine, it will be command.txt. you can't have the .txt part. I use notepad++ to creat files without extensions. You can also do it on the tablet using ES file explorer, root explorer, etc...
Thanks so much for replying!!
Let me ask you or anyone else who knows - When you write "install zip from SD" are you referring to the external or internal?
One more possibly one of the silliest questions that can be asked: How do you move files from one drive to another on this device? I was toying around last night with teh file explorer program and honestlt could not figure it out. I do not use a mouse or anything - normally i would cut/copy and paste teh file to desired location.
Please Help. Thanks again!
SD is generally the internal, MICROSD or SDCARD2 is the external.
Re: The windows notepad. If you want to save a file without the .txt extension or to change the extension simply Save As and put quotes around the name.

How Do I Delete a Corrupted Nandroid Backup

NOTE: I have searched and reviewed the existing threads on items with similar wording. Several on how to recover corrupted files within the backup etc.. Although the questions and issues are similar none describe the issue that I am experiencing.
Samsung Galaxy Note
Rooted on AOSP xXx FJ,(Flappjaxxx) / FJ Mod of ICS UCLF6
Currently on CWM Recovery 5.8.4.3
Situation:
No prior issues experience with nandroid backup, had 2 other backups plus the one I'm referring to (one of AOSP xXx and FJ Modded)
Performed a nandroid backup to try out CM09 from FJ AOSP. All went well... including the CM09 install and apps.
Missed the S-pen functionality and wanted to flip back to FJ Modded ROM.
Attempted to restore the most recent backup... Failed. Booted into CM09 and went to Root Explorer and looked into the backup file. I noticed that the file has a lot of what appears to be random ASCII characters for file names etc... (indicated to me that this file was corrupted).
Since I had other backups, I went to one of the older ones and restored.
Problem: this corrupted backup is taking up about 1.9 GB and I want to delete but it will not allow me. Looked at permissions and it has RW
Question: how the heck do I delete this thing without having to take my SD card out and formatting the sucker?
Thanks in advance
You should be able to plug in your phone to your computer via USB and open folder to view files on the /sdcard. Make sure USB connection is set to "USB Mass Storage" option when connected. Once you opened the folder to view files, you can navigate to the clockworkmod folder, open, and find the backups within that folder and delete that way...
Sent from my MB865 using xda's premium carrier pigeon service
Did you try to delete it in recovery (sorry if there is no such option, never looked for it...) or in root explorer? You could always get a terminal like https://play.google.com/store/apps/details?id=jackpal.androidterm and do like this:
su (if you're rooted)
cd /sdcard/clockworkmod/backup
rm -r 2012-07-12.13.37
Same commands should work in adb as well
Try. Android Commander.
jje
Sent from my GT-I9300 using xda premium
I think that plugging the USB charger into your computer and manually deleting it should do the trick :fingers-crossed:
OK...
Thanks guys for your responses...
- did try connecting to a PC in mass storage mode and tried to delete... did not work
- use Root Explorer to do a delete as well... did not work
- looked to see if there was a delete option in recovery (first thing I looked for) did not find it
I'll try the other options and see where that goes.
JohnnyQ1964 said:
Thanks guys for your responses...
- did try connecting to a PC in mass storage mode and tried to delete... did not work
- use Root Explorer to do a delete as well... did not work
- looked to see if there was a delete option in recovery (first thing I looked for) did not find it
I'll try the other options and see where that goes.
Click to expand...
Click to collapse
If you download clockwork mod (rom manager) you can delete it in the android application in manage and restore backups.
Empty recycle bin on PC sometimes helps when deleted stuff sticks, make sure do this when plugged in ofc
If you're using Windows, run chkdsk ("Scan this drive for errors" in drive's properties) when connected as a mass storage device.
That should help.
If it won't, the guaranteed method is to copy the files you need somewhere else, format the card and put those files back.
to clairfy, you were able to locate the back up files in the folder "clockwork mod-backup" but then it would not delete when you tried?"
Thanks again for all your input.
PC crapped out this past weekend... new hdd installed and re-building with Windows 7 pro-64 (hmmm... maybe I should dual boot to Ubuntu), will need to reinstall some of the linux/android tools.
@frdd... already had terminal installed tried the commands but no luck... it reports back I'm missing files and i get a lot of errors. I guess I'm gonna have to learn Linux/Android
@icomrade... I've got the purchase ver of ROM Manager and haven't fully gone down that rabbit hole but will investigate
@NeverGone\RU... will leave that as a last resort as i've got a 32GB SD card (sucks up time)
@mankows5... yes did find all the directories and files as it should be... just can't delete that 1 backup
Yeah, try Rom manager. Manage and Restore Backups>Select the one you want to delete, then delete it.

[Q] Adb pull failing on a file

I am trying to backup my phone with "adb pull /mnt/sdcard/ SDCARD20121115" but i keep having it fail in the middle of the backup with
cannot create 'SDCARD20121115\Folder\Folder2\Folder3\File.ext'
: No such file or directory
Ideas?
Still having issues with this and not sure how to backup my entire SD card...
Anyone?
Ok so i think i found the two different solutions to my problem.
First what actually was causing the problem was a folder with a $ sign in it. Using the command it looked like it failed on the file right before that folder so it didnt jump out right away.
Second i used a program called android commander that gives a gui. while this wasnt an actually solution i was able to select all but the folder tree structure that was failing instead of doing hundreds of directories by hand.
If anyone has any questions let me know.
*EDIT*
Looks like i had another failure on a folder. The folder had a trailing space "/storage/sdcard0/folder /file.ext"
Possible the $ sign works but to lazy to test.

Questions about VRUEMJ7 Tether Unlock

Two questions about the following thread (can't post in dev threads until 10 posts are made)
http://forum.xda-developers.com/showpost.php?p=47140596&postcount=1
Does anyone still have the files? The dropbox link doesn't contain any files
Is an external microsd card necessary?
The instructions are
Code:
su
cd /mnt/extSdCard/MJ7_tether_unlock/
sh tether.sh
Wouldn't it be fine to copy the MJ7_tether_unlock folder to root and use the following . . . ?
Code:
su
sh /sdcard/MJ7_tether_unlock/tether.sh
I fixed the link. Should download now. And no you cant use that command the reasoning has to do with how I wrote the script. If you dont have a micro sdcard you could also just make a new folder named "extSdCard" in the /mnt directory and then move the unzipped tether folder there.
Sent from my SCH-I545 using XDA Premium 4 mobile app
Surge1223 said:
I fixed the link. Should download now. And no you cant use that command the reasoning has to do with how I wrote the script. If you dont have a micro sdcard you could also just make a new folder named "extSdCard" in the /mnt directory and then move the unzipped tether folder there.
Click to expand...
Click to collapse
I couldn't get r/w in /mnt
I know there's probably a smarter way to do it, and I never tried the chmod you recommended on /system . . . but I re-wrote your tether and untether sh files to use /sdcard/tether instead of /extSdCard/MJ7_Tether_Unlock
I'm not sure how to remove the "crapware" bundled into the VZW S4, but every time I connect it via usb (to my Mint 15 laptop or W7 machine) it asks me to install some Verizon helper junk. It also mounts as a CD-ROM (due to some .ini file)
Does anyone know where this "storage" area is and if it's safe to blow all that crapware away? My S4 gets mounted as CD-ROM everytime whether or not I have USB debugging enabled. In W7 if I cancel it's "Would you like to install this Verizon helper software?" then the S4 is mounted as a portable media player. In Mint 15, I can easily unmount the ROM and the S4 is mounted as a portable media player.
Since I couldn't get past this, I just moved the renamed "tether" folder over to /sdcard which is the only way I can get the phone to mount.
Surge, thanks for the framework patch, and scripts. I like the extSdCard approach since it is always preserved, but it's just a lot easier for me to use the /sdcard since I've not got an external SD and am too cheap to buy one just for this
After running the scripts, I just copied the entire folder over to my computer in case the /sdcard is ever reformatted
I can't attach the whole thing since I'm filesize limited, but I attached the folder with everything except the original MJ7framework-res.apk
Obviously the instructions are close your original, except you just move the tether folder into /sdcard (which is consquently what shows up as "Phone" when mounted as a portable media player storage area in Mint 15???). Then just
su
cd /sdcard/tether/
sh tether.sh
Thank again surge
darker_slayer said:
I couldn't get r/w in /mnt
I know there's probably a smarter way to do it, and I never tried the chmod you recommended on /system . . . but I re-wrote your tether and untether sh files to use /sdcard/tether instead of /extSdCard/MJ7_Tether_Unlock
I'm not sure how to remove the "crapware" bundled into the VZW S4, but every time I connect it via usb (to my Mint 15 laptop or W7 machine) it asks me to install some Verizon helper junk. It also mounts as a CD-ROM (due to some .ini file)
Does anyone know where this "storage" area is and if it's safe to blow all that crapware away? My S4 gets mounted as CD-ROM everytime whether or not I have USB debugging enabled. In W7 if I cancel it's "Would you like to install this Verizon helper software?" then the S4 is mounted as a portable media player. In Mint 15, I can easily unmount the ROM and the S4 is mounted as a portable media player.
Since I couldn't get past this, I just moved the renamed "tether" folder over to /sdcard which is the only way I can get the phone to mount.
Surge, thanks for the framework patch, and scripts. I like the extSdCard approach since it is always preserved, but it's just a lot easier for me to use the /sdcard since I've not got an external SD and am too cheap to buy one just for this
After running the scripts, I just copied the entire folder over to my computer in case the /sdcard is ever reformatted
I can't attach the whole thing since I'm filesize limited, but I attached the folder with everything except the original MJ7framework-res.apk
Obviously the instructions are close your original, except you just move the tether folder into /sdcard (which is consquently what shows up as "Phone" when mounted as a portable media player storage area in Mint 15???). Then just
su
cd /sdcard/tether/
sh tether.sh
Thank again surge
Click to expand...
Click to collapse
I don't recall recommending to chmod /system as that would lead to a brick if done improperly. Also I guess you could change the script and replace all instances of "/extSdCard" to "/sdcard" which is what you did, I just wanted the zip and folder to be named in such a way that youd easily be able to tell what it was. But why even bother with using a pc? I was saying to run the commands through terminal emulator on the phone.
P.S. /system/etc/autorun.iso
Sent from my SCH-I545 using XDA Premium 4 mobile app
I ran them from terminal emulator. I was just referring to mixing the files over to the phone. ES file Explorer wouldn't write in mnt. When plugged in to the laptop I just prefer to move stuff straight in. The only thing I could get to mount was a scarf
Anyway thanks again
Also, does removing the auto run iso from etc have any adverse effects?
darker_slayer said:
Also, does removing the auto run iso from etc have any adverse effects?
Click to expand...
Click to collapse
Removing or renaming the autorun.iso file does not stop the USB connection from connecting as "installer" when you first plug it in. There is still a delay of 20-30 seconds before it switches to "connected as media device" after you plug it in. If anyone has a permanent solution to this, please post it! I've tried changing the settings in the hidden menu *#7284#, but the settings don't stick and revert back to the "connect as installer" after a reboot.
Zelmo88 said:
Removing or renaming the autorun.iso file does not stop the USB connection from connecting as "installer" when you first plug it in. There is still a delay of 20-30 seconds before it switches to "connected as media device" after you plug it in. If anyone has a permanent solution to this, please post it! I've tried changing the settings in the hidden menu *#7284#, but the settings don't stick and revert back to the "connect as installer" after a reboot.
Click to expand...
Click to collapse
Thanks for the info, I was going to ask about this in a separate thread. After your reply looks like I need to look for some other method.
Also, the phone never mounts anything other than /sdcard/ right? Moving things to other places requires an explorer app?
To add to the growing number of noob questions, is it still possible to run ES File Explorer with SU in version 3? I know I used this way in the past, but I can't find the option and it's not showing me a bunch of stuff like /efs/carrier/HiddenMenus or letting me past into extSdCard
Is there a free root explorer if ES can no longer do it?
darker_slayer said:
Thanks for the info, I was going to ask about this in a separate thread. After your reply looks like I need to look for some other method.
Also, the phone never mounts anything other than /sdcard/ right? Moving things to other places requires an explorer app?
To add to the growing number of noob questions, is it still possible to run ES File Explorer with SU in version 3? I know I used this way in the past, but I can't find the option and it's not showing me a bunch of stuff like /efs/carrier/HiddenMenus or letting me past into extSdCard
Is there a free root explorer if ES can no longer do it?
Click to expand...
Click to collapse
I use ES File Explorer without any problems. Do you have "root explorer" switched ON in "Tools" in the ES File Explorer?
Zelmo88 said:
I use ES File Explorer without any problems. Do you have "root explorer" switched ON in "Tools" in the ES File Explorer?
Click to expand...
Click to collapse
Nope
Looked for it in settings, didn't think to check tools

[Q] adb pull fails with 'cannot create...'

Hello everyone,
I am trying to copy my entire sd card from my Nexus 4 to pc using adb pull /mnt/sdcard E:\Backups\nexus-4-sdcard-final\
It's going fine for a while, it's transfering all my files but after a while i get this error message:
Code:
cannot create 'E:\Backups\nexus-4-sdcard-final\Android\data\com.google.android.apps.docs.editors.slides\files\pinned_docs_files_do_not_edit\454c288823047ca656676a9effef1cb5\files\documents\1-MHOqmLRrNLLzh9TfmnCIzJBWxW-TNz3MrEHMsRWjkM\image\1nFkukIkRz4mJ6HfTZCaSv8gv94X-HBr8Rw5Uyy8Y': No such file or directory
I googled for a while and the only thing i found is this guy with similar error but he had folder on his phone with file name longer than 255 characters, it couldn't be created in windows and that's why adb was failing.
My question is:
Is there any flag for adb pull or way to skip files that can not be copied and keep copying?
Or if you can tell me how to avoid this error it's even better solution.
Thanks,
Milos
milos91 said:
Hello everyone,
I am trying to copy my entire sd card from my Nexus 4 to pc using adb pull /mnt/sdcard E:\Backups\nexus-4-sdcard-final\
It's going fine for a while, it's transfering all my files but after a while i get this error message:
Code:
cannot create 'E:\Backups\nexus-4-sdcard-final\Android\data\com.google.android.apps.docs.editors.slides\files\pinned_docs_files_do_not_edit\454c288823047ca656676a9effef1cb5\files\documents\1-MHOqmLRrNLLzh9TfmnCIzJBWxW-TNz3MrEHMsRWjkM\image\1nFkukIkRz4mJ6HfTZCaSv8gv94X-HBr8Rw5Uyy8Y': No such file or directory
I googled for a while and the only thing i found is this guy with similar error but he had folder on his phone with file name longer than 255 characters, it couldn't be created in windows and that's why adb was failing.
My question is:
Is there any flag for adb pull or way to skip files that can not be copied and keep copying?
Or if you can tell me how to avoid this error it's even better solution.
Thanks,
Milos
Click to expand...
Click to collapse
Why not use ADB Backup?
Far better than manually pulling (and easier to restore too).
Jaskaranbir Singh said:
Why not use ADB Backup?
Far better than manually pulling (and easier to restore too).
Click to expand...
Click to collapse
Because I would like to be able to access my files without having to restore them back to a phone.
But if I don't find better solution I will do that. It's better than nothing, right? Thanks for the suggestion.
I have this problem too right now, What was your fix?
The first part of the problem is windows 10 you have to enable long file name support for paths longer than 260 characters . https://www.howtogeek.com/266621/how-to-make-windows-10-accept-file-paths-over-260-characters/ The second part is we need to get Google or one of the XDA members to include a manifest file in the adb that tells windows it supports long file names then it may work otherwise do the adb pull in Linux.
idocinthebox said:
The first part of the problem is windows 10 you have to enable long file name support for paths longer than 260 characters . https://www.howtogeek.com/266621/how-to-make-windows-10-accept-file-paths-over-260-characters/ The second part is we need to get Google or one of the XDA members to include a manifest file in the adb that tells windows it supports long file names then it may work otherwise do the adb pull in Linux.
Click to expand...
Click to collapse
is there a fix yet bro ?
milos91 said:
Hello everyone,
I am trying to copy my entire sd card from my Nexus 4 to pc using adb pull /mnt/sdcard E:\Backups\nexus-4-sdcard-final\
It's going fine for a while, it's transfering all my files but after a while i get this error message:
Code:
cannot create 'E:\Backups\nexus-4-sdcard-final\Android\data\com.google.android.apps.docs.editors.slides\files\pinned_docs_files_do_not_edit\454c288823047ca656676a9effef1cb5\files\documents\1-MHOqmLRrNLLzh9TfmnCIzJBWxW-TNz3MrEHMsRWjkM\image\1nFkukIkRz4mJ6HfTZCaSv8gv94X-HBr8Rw5Uyy8Y': No such file or directory
I googled for a while and the only thing i found is this guy with similar error but he had folder on his phone with file name longer than 255 characters, it couldn't be created in windows and that's why adb was failing.
My question is:
Is there any flag for adb pull or way to skip files that can not be copied and keep copying?
Or if you can tell me how to avoid this error it's even better solution.
Thanks,
Milos
Click to expand...
Click to collapse
did u find any soutions bro

Categories

Resources