Copy files in order of creation date

 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers Copy files in order of creation date
# 8  
Old 09-30-2017
Hi,

OK, I was have trouble getting anywhere. Android itself won't accept all the commands and will simply ignore the sleep command.
So I tried hooking my phone up to a Ubuntu VirtualBox. Unfortunately the VirtualBox is unable to properly mount the phone.

So I now created a live USB stick with Ubuntu on it. I am able to access the phone and all my files.

However, when I execute the commands, I get an error message, that the the "regular file" cannot be created. It creates all the folders/subfolders but is unable to write any files.

I can open the drive manually, create and delete folders etc., so access seems to be there, but why can't it write any files?

Does th system have to be a properly installed Linux? Won't it work on a LiveCD-type system?
# 9  
Old 09-30-2017
can you post the exact commands that you used.
# 10  
Old 10-01-2017
Sorry for the delay. I made a new USB Live Distro. This time with Mint instead of Ubuntu. Just to make sure.

But I get the same errors.

Code:
mint@mint /media/mint/C/-= D =-/S6edge Backup $ stat -c '%Y %n' * | sort -n | while read mtime file; do cp -R "$file" /run/user/999/gvfs/mtp:host=%5Busb%3A002%2C005%5D/Phone/test/; sleep 1; done
cp: cannot create regular file ‘/run/user/999/gvfs/mtp:host=%5Busb%3A002%2C005%5D/Phone/test/apps/2017-09-19_23-53.novabackup': Operation not supported
cp: cannot create regular file ‘/run/user/999/gvfs/mtp:host=%5Busb%3A002%2C005%5D/Phone/test/apps/2017-09-19_23-54 - foldersync.db': Operation not supported
.
.
.

Any ideas? Smilie

Folders were created but no files.

---------- Post updated at 10:34 AM ---------- Previous update was at 07:47 AM ----------

Solved it switching to ptp instead of mtp. But then sleep was ignored and some files failed
# 11  
Old 10-02-2017
Stupid question, but why not use the -p option to cp? This preserves modification timestamp and attributes.

Andrew
# 12  
Old 10-02-2017
Because Android Nougat only allows root users to modify/write timestamps.
It's a known bug in Android 7.0 and won't be fixed until 8.0, which will not be made available to the Samsung S6 edge :-(
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash directory loop and order by creation date?

Hello, how in bash i can get directory loop and order by creation date? THX! :) #!/bin/bash for folder in /home/test/* do if ; then echo $folder; fi (12 Replies)
Discussion started by: ZerO13
12 Replies

2. Shell Programming and Scripting

Script to copy creation date over top of modified date?

Can someone draw up a script that for every file, folder and subfolder and files that will copy the creation date over top of the modified date?? I know how to touch every file recursively, but no idea how to read a files creation date then use that to touch the modification date of that file,... (3 Replies)
Discussion started by: toysareforboys
3 Replies

3. Shell Programming and Scripting

copy files based on creation timestamp

Dear friends.. I have the below listing of files under a directory in unix -rw-r--r-- 1 abc abc 263349631 Jun 1 11:18 CDLD_20110603032055.xml -rw-r--r-- 1 abc abc 267918241 Jun 1 11:21 CDLD_20110603032104.xml -rw-r--r-- 1 abc abc 257672513 Jun 3 10:41... (5 Replies)
Discussion started by: sureshg_sampat
5 Replies

4. UNIX for Dummies Questions & Answers

Renaming files by changing date order

I'm looking for a simple solution to rename a batch of files. All of the files in this directory start with a date in the format mm.dd.yy followed by a space and then additional descriptive text. Example: 01.21.10 742 P.xlsx 02.24.09 730 Smith.xlsx The information following the date can... (3 Replies)
Discussion started by: kreisel
3 Replies

5. Shell Programming and Scripting

Sorting Files by date and moving files in date order

I need to build a k shell script that will sort files in a directory where files appear like this "XXXX_2008021213.DAT. I need to sort by date in the filename and then move files by individual date to a working folder. concatenate the files in the working folder then start a process once... (2 Replies)
Discussion started by: rebel64
2 Replies

6. Shell Programming and Scripting

Order files by create date

hi Is there a way to sort files in the order they were created ,and move them to another directory one by one ,oldest being the first to be moved. Thanks Arif (4 Replies)
Discussion started by: mab_arif16
4 Replies

7. UNIX for Dummies Questions & Answers

How do I organize a series of files in date order?

I'd like to ls a group of files in date order but I'm not sure what the commands would be. Can anyone help with this? (1 Reply)
Discussion started by: hedgehog001
1 Replies

8. UNIX for Dummies Questions & Answers

list of files in date order

Im on HP/UX and am trying to find the command like an ll but that will sort showing the most currently modified programs first. Can anyone help me with that? :cool: (2 Replies)
Discussion started by: Jeannine
2 Replies

9. UNIX for Dummies Questions & Answers

Moving files based on creation date

Howdy, I'm trying to figure out how to move multiple files based on their creation date. If anyone can enlighten me it would be most appreciated!! Thanks! :D (1 Reply)
Discussion started by: dgoyea
1 Replies
Login or Register to Ask a Question