Linux Lite Forums

Software - Support => Other => Topic started by: Sprintrdriver on December 30, 2017, 12:27:47 PM

Title: file copy from fat/ntfs - only copy newer files
Post by: Sprintrdriver on December 30, 2017, 12:27:47 PM
Hi.

Background (may be boring stuff)
This is one of my MS windows habits when it comes to copy files from my digital camera to local disk. When I used windows, I always used to use MS explorer and sort files by attributes - because that way, I was able to sort out new files only - that is the files where the attribute archive are set. And from there, I could easilly copy only new files from memory card to disk, and then unset the archive attributes for all files on SD-card that was copied.
I have found no way of being able to sort the files in same way using Thunar. Assume the archive attribute is a fat/ntfs feature only.

So I think I need help to solve the problem in either of two ways:

1. copy files - but only those files where archive attribute is set.
In MS-dos / windows command line - the command is xcopy /A.

2. Copy files - but only those that is changed after given date.
This also work for me. The "only copy files achive attribute set" solution would be the best one because about every digital camera utilize fat filesystem, and I don't need to look at the files using a file manager to look for the last date after last time I copied files from camera.

3. Same as 2 - but store a timestamp for when the file copy operation occured last time
Don't know if this is possible. I thinking of storing a local file onto the sd card (in the camera). That text file should consist of one line only, and that is a string that contains the date and time. That time stamp should be changed every time the file copy is done.
And - for every file copy operation, only the files that has a timestamp that is newer than the time stored in text file should be copied.


Tanks
Title: Re: file copy from fat/ntfs - only copy newer files
Post by: Moltke on December 30, 2017, 06:14:47 PM
Hi @Sprintrdriver

Quote
I always used to use MS explorer and sort files by attributes - because that way, I was able to sort out new files only

You can do the same in Thunar using the context menu and file manager preferences: edit > preferences..

Read here http://docs.xfce.org/xfce/thunar/the-file-manager-window and here http://docs.xfce.org/xfce/thunar/preferences

Hope this heps! :)
Title: Re: file copy from fat/ntfs - only copy newer files
Post by: Sprintrdriver on December 30, 2017, 06:38:13 PM
Thanks for answering.

I still cannot find a way in Thunar to view or sort files by (FAT/NTFS only) attributes (hidden, system, archive . . .). It simply is no option for that - and frankly it is a MS thing, so I have no intention complaining as this is not used in file systems normally used in Linux.
But - a good workaround is very apprechiated  :)

I kind of found a solution in a norwegian general computer forum - suggesting using Rapid Photo Downloader. Haven't used that yet.

Still interresting if this can be solved by using a more simple command using terminal.
Title: Re: file copy from fat/ntfs - only copy newer files
Post by: Moltke on December 30, 2017, 07:52:30 PM
You might try  "ls" command:
Open the folder containing your files > right-click and select "open terminal here" >  and try these: *ls -laxo and *ls -ltr
From the man pages for ls:

*ls -laxo Lists files with permissions, shows hidden files, displays them in a column format, and suppresses group information.
*ls -ltr List files sorted by the time they were last modified in reverse order (most recently modified files last)

If that provides the result you want, then you could copy your files using the "mv" or "cp" command or simply go to the folder in thunar and select those you want to.

Hope this helps! :)
Title: Re: file copy from fat/ntfs - only copy newer files
Post by: justme2 on December 31, 2017, 05:10:27 AM
Not a cmd line solution, but check out Freefilesync. Nice GUI application and I think it will do what you want - only copy files from SD card which do not exist on HDD. That's how I sync my camera and PC anyway.
Title: Re: file copy from fat/ntfs - only copy newer files
Post by: Sprintrdriver on January 10, 2018, 04:18:59 PM
Hi. No I'm not looking for a way to sync files.

Btw - I asked in Ubuntu forum, and a possible solution seems to use a tool named fatatr (haven't tried yet)
https://ubuntuforums.org/showthread.php?t=2381969&p=13728020#post13728020