Author Topic: SyncBackup & ssh-askpass  (Read 20879 times)

Ben

  • Guest
SyncBackup & ssh-askpass
« on: September 15, 2013, 04:04:07 pm »
I have been using SyncBackup with rsync here, with great success, for a while now.

Recently I tried to use it to backup to a Ubuntu machine.

Do anyone here know if there is such a package, (ssh-askpass), for OS/2?

Doug Bissett

  • Hero Member
  • *****
  • Posts: 1604
  • Karma: +4/-2
    • View Profile
Re: SyncBackup & ssh-askpass
« Reply #1 on: September 16, 2013, 12:11:55 am »
I don't know of any such package, but I think it is unnecessary anyway. Linux users seem to be obsessed by user IDs, and passwords, so that is probably where your problem lies.

I have been trying Linux Mint 15 Olivia Cinnamon 64, which is based on Ubuntu. I got RSync (eCS) to send data to it from eCS by doing this:

Make a directory in the home folder to receive the data (I called it RSyncData).

Create rsyncd.conf in the etc directory (use root to create/edit it). The contents are:
Code: [Select]
    read only = false
    timeout=1200
    log file = rsyncd.log

[backups]
    hosts allow = 192.168.0.100/24
    comment = Backup storage area
    path = /home/dougb/RSyncData
    gid = root
    uid = dougb

My user ID is dougb, and the machine IP address is 192.168.0.101. Change to match your machine, and ID. The log file ends up in the user's (dougb) home directory.

If RSync is already running, it should find the changes to rsyncd.conf. If it isn't running, start it.

I just use RSync, without the SyncBackup front end, so I am not too sure how you configure that. On the eCS end, I used a batch file to do the RSync command:
Code: [Select]
SET RSYNC_PASSWORD=1234567

W:\UTILITY\RSYNC\BIN\RSYNC.EXE -a --delete --log-file=logs/RsyncTest.log U:/acpi/ 192.168.0.101::backups/

This starts RSync, to copy the contents of U:/acpi to the RSyncData folder in Linux. The password is the password for the user defined in the rsyncd.conf file (uid).

Once you get it actually working, you can add whatever else you need (which SyncBackup probably does anyway). The trick seems to be to set the password, in the environment variable, before starting the program, so that RSync can use it.

I use a timeout value of 1200 (seconds), because RSync seems to time out, and cut off the transfer, if an individual file transfer takes longer than the timeout. That happens with large files, and slow connections.

Ben

  • Guest
Re: SyncBackup & ssh-askpass
« Reply #2 on: September 18, 2013, 08:54:25 pm »
Thanks for replying, Doug.

Most of that I had done, with some exceptions as relates to getting around the password; that I have now solved by combining your *.conf with mine and by setting the environment variable for the password.

Working with the commandline here, I noticed in your example;
Quote
192.168.0.101::backups/
... called "backups/". I first I thought it to be a directory, but the "::" defines it as a module.

How does that apply... or is it not related/necessary?

Doug Bissett

  • Hero Member
  • *****
  • Posts: 1604
  • Karma: +4/-2
    • View Profile
Re: SyncBackup & ssh-askpass
« Reply #3 on: September 18, 2013, 11:22:11 pm »
Quote
Working with the commandline here, I noticed in your example;
Quote

    192.168.0.101::backups/

... called "backups/". I first I thought it to be a directory, but the "::" defines it as a module.

How does that apply... or is it not related/necessary?

The module is "backups". The directory to use, in that module, is "/", or the root of the module (/home/dougb/RSyncData). In this case, it is probably not necessary, however, if you wanted to store the U:\ACPI data in /home/dougb/RSyncData/ACPI you would use the command:
Code: [Select]
W:\UTILITY\RSYNC\BIN\RSYNC.EXE -a --delete --log-file=logs/RsyncTest.log U:/acpi/ 192.168.0.101::backups/ACPI/Note that Linux is case sensitive, so it will create, and use, the upper case directory name (in this case), while eCS doesn't care about that.

The trailing slash (on both source, and target), gives you a little more control over what RSync will work with. Look up "trailing slash" in the RSync docs.

Ben

  • Guest
Re: SyncBackup & ssh-askpass
« Reply #4 on: September 19, 2013, 01:03:08 pm »
Quote
The module is "backups". The directory to use, in that module, is "/", or the root of the module (/home/dougb/RSyncData).

I went ahead on that assumption, but rSyncd on the other end, continues to report "@ERROR: Unknown module" leading one to believe that there is something wrong with the directory configuration... but there isn't; both sides are in sync and the directories exist.

It is peculiar though, that it is called a "module" and not as a "directory"... which would be typical and expected.

It also reports "rsync error: error starting client-server protocol (code 5) at main.c(1649) [sender=3.0.9]"

I'm close, but I need to dig deeper...

I'll post my findings.

Doug Bissett

  • Hero Member
  • *****
  • Posts: 1604
  • Karma: +4/-2
    • View Profile
Re: SyncBackup & ssh-askpass
« Reply #5 on: September 21, 2013, 05:18:54 pm »
Don't forget that the module name is case sensitive. It must match, exactly, on both ends.

Ben

  • Guest
Re: SyncBackup & ssh-askpass
« Reply #6 on: September 29, 2013, 09:23:42 pm »
OK.

I finally got the time to get back to this and all is well.

I'll make this post in some detail to help others who might be trying something similar.


--

I have two machines:

    a) eCS      - my main machine.
    b) Ubuntu - a file server.


Simply put, I was trying to transfer a HUGE number of small files to the file server. FTP while great at large files, looses too much in the overhead to be practical for my present purpose.

I am testing to see if rSync is superior; so far the results are encouraging.

To obtain this on the Ubuntu side I installed rSync:

   "sudo apt-get rsync install"

Once installed I created a file name rsyncd.conf, (note the "d"), and gave it basic settings. Here it is;


      log file       = /var/log/rsyncd.log
      timeout     = 1200

[documents]
      path           = media/
      comment    = root path for this connection
      uid             = ben
      read only    = false
      list             = true
      hosts allow = 192.168.0.1


That is all that I used though there are many more things that can go in there and that was all that I needed.

"[documents]" is the module name that you must include after the "::" in the parameters when using the client.
"path" is obvious; the base directory where you want the remote user to start.
"comment" This is a comment that you would wish to user see when connecting.

This too is a comment that I would like the user to see: *nix is too arcane for even Aliester Crowley to use. (Hands up those who understand that comment?) 8) In simple terms, too much time is wasted doing something simple and mundane. OS/2 does not suffer from this affliction. It has both the power of *nix and the power of the WPS. There is nothing out there even now, that is close to it... just different.

To continue...

"uid" is also obvious, it is the name of the user who wished to connect.
"read only = false" allows the remote user to write as well as read into and from the directory in the "path".
"list" allows the user to list the contents.
"hosts allow" determines what machines have permission to connect.

"Modules" refer to the rsyncd.conf file which has two classifications of sections within; "general parameters" and other sections which are called "modules". These modules define certain settings and are grouped as the user sees fit as in keeping alignment with the manpages on the subject; you can have more than one "module" per rsyncd.conf

Now, I'm not going to go too deeply into this but, here is the commandline parameters that I used on the eCS machine to connect to my Ubuntu File Server and to enable me to transfer the files.

After opening a cmd in my rSync/bin directory, I first used the "set" command;

SET RSYNC_PASSWORD=*place your password here*

Then I issued the following command;

rsync --progress --log-file=logs/RsyncTest.log  -avvz h:/*source directory*/ ben@192.168.0.4::documents/*destination directory*

Obviously, I will refine the whole process and I will [encapsulate] it all within a *.cmd file(s) of my own making, thus easing the process and allowing me to gracefully forget the whole thing, so that next time I can enjoy doing it all again! ;) Define the word "masochist".

I hope that helps someone.

P.S. A "thank-you" to Doug for his contribution, some of which I included.

P.P.S. Pardon me if some of that wasn't clear; all mistakes within are my own.

« Last Edit: September 30, 2013, 10:49:00 am by Ben »

Doug Bissett

  • Hero Member
  • *****
  • Posts: 1604
  • Karma: +4/-2
    • View Profile
Re: SyncBackup & ssh-askpass
« Reply #7 on: September 30, 2013, 04:47:09 am »
Quote
      gid             = *insert your password here*

According to what I read, "gid" stands for "Group ID". That would seem to have nothing to do with passwords. In fact, I suspect that it is probably ignored, since it doesn't seem to matter what I put in that setting.

The RSync docs indicate that RSync (client) gets the password from the environment variable, which can be set just before opening RSync, or it could be set globally in CONFIG.SYS (with the associated security concerns). It seems that Linux (server) associates the uid (User ID) with the password that is assigned to that user. In eCS, or OS/2, it seems to always use "root" for both uid, and gid, which makes sense because eCS doesn't have the user ID association to passwords support.

Ben

  • Guest
Re: SyncBackup & ssh-askpass
« Reply #8 on: September 30, 2013, 10:48:19 am »
OK.

I have modified my last message to add the missing elements, (as previously stated I would), and I have removed the useless "gid" references.

Ben

  • Guest
Re: SyncBackup & ssh-askpass
« Reply #9 on: October 17, 2013, 02:05:19 am »
I just have to throw this in here as a supplement and conclusion to this thread.

rSync works extremely well. It is a nuisance to setup, but once configured, runs fast... very fast! and incredibly smoothly.

It works beyond my expectations.

It is exactly what I needed and fills a position by itself.

Just saying that to let the readers know that it is definitely worth the effort.

I have many rSync configurations now, running via chron, (actually, DragText), on many different machines... all running silently and without attention while I'm sleeping soundly! 8)

Hehe.