Access to a terminal window / command line ( Activities > Search > type Terminal).Print "Usage: ", sys.argv, "currentdir olddir difference"ĭestination_files.append(re.sub(dir1, dir3, item)) Os.path.abspath(os.path.join(dir2, item)), Os.path.abspath(os.path.join(dir1, item)), It usage is simple - give it the absolute path of new directory, old directory and difference directory in that order. I have posted the whole script and usage in my personal site. But in my case I had to write my own script using Python, as python has the "filecmp" module for file comparison. I am not sure whether you can do it with any existing linux commands such as rsync or diff. It doesn't necessarily have to be using rsync, but I'd like to know what I'm doing wrong if possible. I have been looking for a solution for the past couple of days and I'd really appreciate some help. I ran the above command and checked the results in difference.I changed the contents of some of the files in new and added a few additional files.I made several text files with different contents in old.
In case it helps (maybe the command is fine and the fault lies elsewhere), this is how I tested this: What this does however, is copies all the files from new to difference, even those which are the same as in old. Most sources suggested the use of rsync so I ended up with the following command: rsync -ac -compare-dest=./old/ new/ difference/ I have searched all around and it seems like a simple thing to tackle, but I can't get it to work in my particular example. How do you compare old with current and copy the files which are different (or entirely new) in current to difference? folder difference, which is just an empty folder.folder old, which contains an older version of the same files.folder current, which contains your current files.