This forum has been archived. All content is frozen. Please use KDE Discuss instead.

copy only changed files with Dolphin

Tags: None
(comma "," separated)
houndhen
Registered Member
Posts
4
Karma
0
OS
Did a search here and with google but didn't find an answer.

Is there a way to copy only the files that have changed using Dolphin?

What I want to do is copy files from dir1 to dir2 (which are similiar) but not have to click on skip after reading the properties of each file.

Thanks,
Harold
User avatar
annew
Manager
Posts
1155
Karma
11
OS
You could always use the Details view mode and sort by date.


annew, proud to be a member of KDE forums since 2008-Oct and a KDE user since 2002.
Join us on http://userbase.kde.org
houndhen
Registered Member
Posts
4
Karma
0
OS
Since I am an old windows user I was wondering if there was something like a file attribute that I could use like in windows. In Windows if the file attribute has been set then the file has changed. Just wondering.

Thanks,
airdrik
Registered Member
Posts
1854
Karma
5
OS
Files do have a last modified timestamp which is presented in the 'Date' column in dolphin's details view (as pointed out by Annew). You can just check which files have a newer timestamp than the last time you did the copy.

I suppose it could also be nice to have an option when copying files to Overwrite if Newer which automatically checks the timestamps.


airdrik, proud to be a member of KDE forums since 2008-Dec.
houndhen
Registered Member
Posts
4
Karma
0
OS
airdrik wrote:I suppose it could also be nice to have an option when copying files to Overwrite if Newer which automatically checks the timestamps.
That is exactly what I am talking about.

When I was using windows full time there were bat files that weren't that hard to write to do stuff like that. I have no experiece in Linux that is similiar. I know that people write scripts but I haven't tried to write any. Not sure that I even know how to run a script in Linux. I am not that familiar with the command line commands (there are so many). Maybe I will search for a script that will compare time stamps of two files with the same name and overwrite if newer and skip if the same. Also it would need to copy any files that don't exist in the destination folder. Of course it would need to have user input so you could name the folders that the user is dealing with.
airdrik
Registered Member
Posts
1854
Karma
5
OS
A basic shell script is little different from a windows batch script - you list the commands that you want to run. There's also some extended syntax for control flow, running processes in the background, piping output from one command to another, etc. but for basic running one command after another most of that is unnecessary.
Running a shell script from the command line is usually as simple as typing "sh <name of script.sh>" (or bash <name of script.sh> if using bash extended syntax).

There is a nice (command-line) utility which can handle keeping two directories in sync (it even works over network connections like ssh/telnet) called rsync. When run on a source and destination it checks which files are newer or more recently modified on source than on destination and copies over the newer/changed files (making use of compression to minimize network traffic). I'm not really very familiar with how exactly to use it, but you can do some research (read the man page for it - at the command line enter: man rsync) to find out for yourself how to make it do what you want.

Once you have the command(s) figured out, you can then create a desktop shortcut that you can use to run the command just by clicking on the icon by right-clicking in the directory where you want to create the shortcut -> Create New -> Link to Application, and filling in the necessary details.


airdrik, proud to be a member of KDE forums since 2008-Dec.
User avatar
NickElliott
Registered Member
Posts
258
Karma
3
OS
Another alternative is to use one of the many GUI's which use rsync, though this maybe overkill.

I use a backup utility called luckybackup (http://luckybackup.sourceforge.net/) which has a synchronisation feature which I use to sync data to a portable HDD for when I'm away from home. Works well.


NickElliott, proud to be a member of KDE forums since 2008-Oct.
User avatar
andreselsuave
Registered Member
Posts
10
Karma
0
Yeah, rsync is really cool. I love using it to make backups of my system. I think it would be nice though to have a rsync dolphin plugin. Maybe i will have a look @ ubuntu brainstorm and if the idea is not there I will post it ^_^.

Andrés
vertago1
Registered Member
Posts
3
Karma
0
When doing large copies (especially with lots of small files), dolphin's copy is much slower than rsync. I haven't looked at the source so I don't know that dolphin is the problem but I was considering looking at writing an rsync plugin if one didn't exist.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
While writing a plugin to invoke RSync itself would be extremely difficult, you likely could write new code to allow KIO (the underlying system which provides for file access to KDE applications like Dolphin) to perform it's copying in a manner more similar to RSync.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
luebking
Karma
0
When doing large copies (especially with lots of small files), dolphin's copy is much slower than rsync.


Also define "copies".

- Do some (many) of the to be copied files already exist in the same version on the destination path? (rsync by default only checks size and timestamp)
- What filesystems are invoked?
- Is ssl (or any network) invoked?
- Do you copy exactly the same?
(eg. copying a directory w/ 1000000 files should be faster than copying 1000000 files - on most filesystems)
vertago1
Registered Member
Posts
3
Karma
0
Usually, it does involve ssl such as when I use sftp to copy files between computers. Most of the time I use unison though. Even when I have copied hundreds of megs of source files onto or off of a usb hard drive rsync has been faster in my experience. In the future I will make a note of when I come across a case where I stop copying from dolphin and switch to rsync because of speed. This might be an illusion because of the way buffering works on usb.


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot], rockscient