news

7th February 2013

Changed this page from a "dummy" to one that talks about JFileSync and our use of it.

day Month 20xx

NOTES: This area can be used for news or any other info.

other info

In trying to organize this a "little" better, we decided to move our File Syncing over here to the Site Building area. Course we really hadn't had any particular place for it anyway. It 'was' just another Web Page with info. Now we have a spot with which to find -and- use it.

additional links

another link

another link

Design Continuation...file Syncing   page 9

In keeping with our decision to use this dcarter creation for our Web Building info we are moving our latest discovery information to here. This was one of the "dummy" pages; ie; spot holder. Now it has a purpose... -and- our JFileSync info can be found. This was created in December of 2012 -but- we re-created it here.

    JFileSync - Java File Synchronization

 File Syncing  Our main purpose and intent. We have started "sharing" our WebPage files between our Windows 7 Laptop and our openSuSE Linux Desktop. Now sharing may not be the correct word, but it will suffice for the moment. What we are really doing is trying to use "both" machines to build our WebPages. Since we make lots of changes to the Desktop, (ie; new versions of SuSE) we decided to make the Laptop our "Main Machine" for our WebPages. Some may say that is bad cause of the portability of the Laptop -but- 90% of the time it is right here next to the Desktop. It, the Laptop, has become a very important part of our day-to-day operations. We had put off getting a Laptop because we thought that it would sit and go unused 'most' of the time. Because of a "Hard Disk" failure on our Desktop, that concept got changed. Since then we have been working with both.

We, for the most part, keep our WebPages on our Laptop. However, we like the keyboard and screen of the Desktop better. So, with our latest setup (since May of 2012), we have our two machines Networked together. -And- we can edit the files on the Laptop from the Desktop. However, there are times that we want to "capture" something on our Desktop and place it in our WebPages. This is much easier IF the file being edited is 'on' the Desktop. So, another reason for the "Sync" need... and just because.

Now there are some programs out there that we could use to maintain this synchronization -but- they either cost lots of, well deserved, money -or- we haven't had the time to check them out -or- both. And at this time we trust ourselves more so than the others. Just the way it is. That is the reason for the 'find' info further down below.

 JFileSync -February 7th, 2013 / 6:45am  We found this one on the Web and it claims to be able to Sync between Windows and Linux - which is just what we need. It is a Java applet program and requires JRE 5.0 or later. To check IF Java is installed and which version go to Java.com. We had Version 6 Update 31. Version 7 Update 4 was offered so we brought it down... and installed it on the Laptop. The Linux Desktop was left alone. We'll see how it works. Mainly cause we couldn't figure out how to get a later version. One of those Linux - openSuSE things. -And- at the moment we don't want to take the time. However, we do plan on using it... in the not to distant future. Just take note... you need a working Java on 'both' machines.
Refer: JFileSync

java -jar /windows/L/jfilesync/lib/jfs.jar

This JFileSync is basically one file, jfs.jar, which was placed on our Linux Desktop in a newly created directory - /windows/L/jfilesync/. It is executed on our Linux Desktop, after switching to the library(lib), as "java -jar jfs.jar".

 Added -February 7th, 2013 / 6:58am  On the Windows Laptop we created a directory inside /xampp/htdocs called jfilesync/. JFileSync files were copied over to it with appropriate changes. So with this, the Java applet will execute on both systems... and it is directly above the public_html dir. Well, the dir containing it is, on both Systems. Now to read up on how to use it.

JFileSync is used to synchronize 'pairs' of directories. For instance, if you want to ensure that a certain set of files located on your Workstation matches a corresponding set on your Laptop or an external data drive.

 Added -February 7th, 2013 /8:42pm  According to the Help file, we must first create a synchronization profile. This will specify the directory pairs.

 Networking!! Injected -June 3rd, 2013 /12:27am  We forgot to include this part!! We are "Restoring" from our latest drive fiasco and we are setting up this 'Synchroization' again. One of the requirements is that the machines can see each other. That involves a LAN. And that involves 'Permissions' and 'Sharing'. On the Linux side make sure 'smb' and 'nmb' are running... and 'apache2'... and 'dns'... and the 'servers'. This gets our LAN and Samba operations in motion.

   TRDM4 to Dusty-tr2    Oh Darn!! Put something on the Linux Desktop last time that we could click on to see the Laptop from the Desktop. Can't remember what it was.?.? Something from 'James'?? Nope! Something right in the commands.
    Gecko Launcher -> Computer -> Network -> Samba Share -> TRComputing
OK! We can see 'both' from 'both'.

 First use:  

  • Started it up on the Laptop.
  • Edited/Created our profile:
        Source: C:\xampp\htdocs\public_html <- on the Windows Laptop
        Target: \\Dusty-TR2\windrvl\public_html <- on the Linux Desktop
      Second Use:  
      Actually, a change from the 'old MainMama' to the 'new MainMama'. Should be able to have both. Re-reading will be required -but- I do believe that the 'Targets Pairs' were selectable... on both machines. In this case the 'LapTop' will remain the same. Saved a copy to the 'old MainMama' before proceeding.
      Target: \\Dakotah-i7\WinDrvF-i72\public_html <- on New Linux Desktop
  • Did the Compare - took about 15mins or so... we forgot to time it.
    May 6th, 2016 /11:19pm We did a sync with the files on WinDrvF-i72 that we had copied days ago. It found differences and then synchoronized the two. Evidently, I got Java setup correctly on the new PC.
  • Oooops we see that it says 11min 31sec along the bottom.
  • Now it wants to Sync -and- we are just not sure which way it is going.
  • MyCompAdventures.html is different on both. It wants to know which to copy.
    Now this is silly -but- it offers to 'Copy Source' -or- 'Copy Target'.
    Is that to -or- from??? We have saved both of the files that we changed
    and we want to copy 'from' the Linux PC 'to' the Windows Laptop. So,
    we are gona say "Copy Target".
  • Now we exit... check which way the copy went and add in these notes.
  • We clicked on 'File' and then 'Exit' and it asked if we really wanted
    to exit. Hmmmm?? Why?? Don't know -but- we just exited and we'll see
    what happens when we start it up -after- we check our files.
  • Ok. Nothing going/changed on the Windows PC. So, we are gona fire up VMware/ Win2k/ Homesite on the Linux Desktop and check things out.
===================
Well, we didin't do something right. It did NOT over-write the files on
our Desktop -but- it didn't copy them over to the Laptop either.
Might have something to do with "Are you sure you want to exit?" Hmmmm...
===================
Must go to work... will play more afterwards.

When is the copy/over-write performed???

And the answer is... when you allow the Synchronize to finish... everything. No skips. We had skipped one... well what we thought was the rest... and it turned into everything. So, for now, till we learn more about this... we will just click all the buttons through to the end. Will try to list them here shortly. To be on the 'safe' side, we are exiting our Homesite editor -before- we try the 'synchronization'. Even though we have done a save.

 Ok now, this is the order it is done
First Edit the file -on- the Desktop PC. Then the following operations are performed via JFileSync on the Laptop.

  1.  Start Assistant 
  2.  Edit Profile  - Everything looks good. No changes. Click Ok
  3.  Compare  - Show Details - should only find one... this one. We see that it has listed this file on both sides. The Laptop at 12/9/12 5:26pm -  Desktop  at 12/10/12 8:22am -But- it is checking them all. 12m0s.
  4.  Synchronize  - Show Details - It shows: Copy 'from' Desktop 'to'  Laptop .
    Click Ok. Says Synchronization was performed successfully.
  5.  Close 
  6. File - Exit - Ok, really quit.
  7. Check the Laptop file... Yep! It got updated.
    • Alllllrighty Now... Let us see IF it will go the other way... changes made to the files on the Laptop and then sync'd with the Desktop.
  8. Editing the file... this one again... only on the Laptop.
  9. Now Jump back to step one... and repeat.
  10. Allllllrighty.... it goes 'both' ways!! We are Happy!!
  11. However, can not be in a hurry. It takes almost 15min to perform the Synchronization. -But- that is a short time in comparison to the manual way.


GNU Utils

The following was originally presented by: The Geek Stuff. Anything correct, they get the credit, anything incorrect we'll take the blame, cause we did make changes and additions to suit our needs. -But- use at your discretion. There is more info at their site. We only copied over the portion that we were interested in at this time.

-And- what was that?? We wanted to check the modification -or- changed times of the files comprising our WebPages. We could then compare them and take the appropriate actions. Using the 'find' command on Linux -and- 'Windows Explorer' on Windows, we could peruse the WebPage directories and compare the dates. This was not as big a hassel as it sounds. We had not made that many changes. Now we have the same files on both machines (except this one) -and- they are backed up. Now we can 'experiment' with JFileSync. Weelllll... only IF we pay attention to what machine we are on!! -And- this very first time -- we didn't. Was editing the Laptop files on the Desktop insted of the files on the Desktop. That mistake/oversight has been corrected and for a brief moment these files were the same again.

Find Files Based on Access / Modification / Change Time

You can find files based on following three file time attributes:

  1. Access time of the file. Access time gets updated when the file accessed.
  2. Modification time of the file. Modification time gets updated when the file content modified.
  3. Change time of the file. Change time gets updated when the inode data changes.

 
In the following examples, the difference between the min option and the time option is the argument.

  • min argument treats its argument as minutes. For example, min 60 = 60 minutes (1 hour).
  • time argument treats its argument as 24 hours. For example, time 2 = 2*24 hours (2 days).
  • While doing the 24 hours calculation, the fractional parts are ignored so 25 hours is taken as 24 hours, and 47 hours is also taken as 24 hours, only 48 hours is taken as 48 hours. To get more clarity refer the -atime section of the find command man page.

Example 1: Find files whose content got updated within last 1 hour

To find the files based up on the content modification time, the option -mmin, and -mtime is used. Following is the definition of mmin and mtime from man page.

  • -mmin n File’s data was last modified n minutes ago.
  • -mtime n File’s data was last modified n*24 hours ago.

 
Following example will find files in the current directory and sub-directories, whose content got updated within last 1 hour (60 minutes)

# find . -mmin -60

 
In the same way, following example finds all the files (under root file system /) that got updated within the last 24 hours (1 day).

# find / -mtime -1

Example 2: Find files which got accessed before 1 hour

To find the files based up on the file access time, the option -amin, and -atime is used. Following is the definition of amin and atime from find man page.

  • -amin n File was last accessed n minutes ago
  • -atime n File was last accessed n*24 hours ago

 
Following example will find files in the current directory and sub-directories, which got accessed within last 1 hour (60 minutes)

# find -amin -60

 
In the same way, following example finds all the files (under root file system /) that got accessed within the last 24 hours (1 day).

# find / -atime -1

Example 3: Find files which got changed exactly before 1 hour

To find the files based up on the file inode change time, the option -cmin, and -ctime is used. Following is the definition of cmin and ctime from find man page.

  • -cmin n File’s status was last changed n minutes ago.
  • -ctime n File’s status was last changed n*24 hours ago.

 
Following example will find files in the current directory and sub-directories, which changed within last 1 hour (60 minutes)

# find . -cmin -60

 
In the same way, following example finds all the files (under root file system /) that got changed within the last 24 hours (1 day).

# find / -ctime -1

Example 4: Restricting the find output only to files. (Display only files as find command results)

The above find command’s will also show the directories because directories gets accessed when the file inside it gets accessed. But if you want only the files to be displayed then give -type f in the find command as
 
The following find command displays files that are accessed in the last 30 minutes.

# find /etc/sysconfig -amin -30
.
./console
./network-scripts
./i18n
./rhn
./rhn/clientCaps.d
./networking
./networking/profiles
./networking/profiles/default
./networking/profiles/default/resolv.conf
./networking/profiles/default/hosts
./networking/devices
./apm-scripts
[Note: The above output contains both files and directories]

# find /etc/sysconfig -amin -30 -type f
./i18n
./networking/profiles/default/resolv.conf
./networking/profiles/default/hosts
[Note: The above output contains only files]

Example 5: Restricting the search only to unhidden files. (Do not display hidden files in find output)

When we don’t want the hidden files to be listed in the find output, we can use the following regex.
The below find displays the files which are modified in the last 15 minutes. And it lists only the unhidden files. i.e hidden files that starts with a . (period) are not displayed in the find output.

# find . -mmin -15 \( ! -regex ".*/\..*" \)

Example 6: Restricting to specific files

To find all *.mk files modified in last 60 seconds.

# find . -name "*.mk" -mtime -60s

 March 9th, 2015/6:37am  Credits to:  SuperUser   for helping to clarify... at least to me. Needed the -name "*.mk" part to accomplish my task.