D3 and mvBase

 View Only
  • 1.  File transfers

    PARTNER
    Posted 29 days ago
    Edited by Alex Polglaze 29 days ago

    Periodically I have to transfer a single file, usually .txt, from D3 to the Desktop. There is a function in SB+ to do this to a Windows Desktop environment, but I want to transfer the file to a Linux Desktop. I have looked at scp, but can't quite understand the source path from the D3 partition. Any ideas or other suggestions welcome. Once I get it working, I intend to establish it as a script in SB+ to be used multiple times. Thanks. Alex



    ------------------------------
    Alex Polglaze

    The Book-Keeping Network
    Perth Western Australia
    +61419 776 348
    apolglaze@book-keepingnetwork.com.au
    https://www.book-keepingnetwork.com.au/
    ------------------------------



  • 2.  RE: File transfers

    ROCKETEER
    Posted 25 days ago

    No idea. Maybe post some details of your solution to the Windows desktop for reference and a clue?



    ------------------------------
    Brian S. Cram
    Principal Technical Support Engineer
    Rocket Software
    ------------------------------



  • 3.  RE: File transfers

    PARTNER
    Posted 25 days ago

    Hi Alex,

    The key here is that it is not d3 transferring to a Windows desktop environment per-se.

    Instead it is really a function of the terminal emulator, in your case either SBClient or Termite etc. These tools come with d3 routines to be installed which "know" the commands which the matching client will understand; PLUS the ability for the Client to initiate commands on it's environment (Windows).

    So, if you are changing the environment (Windows --> Linux) then you will need:

    1. A Linux T/E with SBClient -like abilities
    2. Software from said T/E authors to be installed on d3 which passes data to the T/E and
    3. For Linux to have execution abilities analogous to Windows

    I am not aware of anything like that. So the only way would be some type of detailed setup where d3 would place something into a shared central drive which has been mapped to a common letter/location which a Linux command, perhaps on a schedule looks for and executes.

    D



    ------------------------------
    David Knight
    Managing Director
    Matash Australia Pty Ltd
    AU
    ------------------------------



  • 4.  RE: File transfers

    PARTNER
    Posted 24 days ago

    If your Linux desktop system has sshd running (that is, you can ssh into the linux desktop system from another system) then I think you're idea to use scp is the right one. If the file you want to copy is an item in D3 then I would first copy it out to, for example, /tmp on the D3 server system, and then use scp to copy it to the linux desktop system. The scp command would be something like (executed from TCL in D3):

    !scp /tmp/myfile.txt username@desktop.ip.address:~/Desktop

    (The details for the Linux desktop system may be slightly different on your system!)

    Now presumably you wouldn't want to have to enter a password, so you'd want to set up a public/private key pair on your D3 server and put the public key into the desktop user's ~/.ssh/authorized_keys file.



    ------------------------------
    Martin Shields
    Senior Technical Consultant
    Meier Business Systems PTY LTD
    Carnegie VIC AU
    ------------------------------



  • 5.  RE: File transfers

    PARTNER
    Posted 19 days ago

    That did it.

    We already had a routine to transfer other files to /tmp, so I incorporated that into a new programme and then coupled that with an scp command as follows;

    !scp /tmp/myfile.txt  user@computername:/home/user/Desktop/Transmitfiles

    All that is left now is some variable defining. so that it is automatic on each desktop and it is finished.

    Thanks everyone for your suggestions.

    Alex



    ------------------------------
    Alex Polglaze

    The Book-Keeping Network
    Perth Western Australia
    +61419 776 348
    apolglaze@book-keepingnetwork.com.au
    https://www.book-keepingnetwork.com.au/
    ------------------------------



  • 6.  RE: File transfers

    Posted 23 days ago

    one alternative is to use the kermit tool from the linux side, and activing the tranfer in the client side ( usually some vb instructions) deppending of the client used to to connect



    ------------------------------
    Alberto Leal
    System Analyst
    Millano Distribuidora de Auto Pecas Ltda
    Varzea Grande MT BR
    ------------------------------



  • 7.  RE: File transfers

    PARTNER
    Posted 22 days ago

    Hi Alex,

    something I did years ago for a client who had salesmen send in orders remotely was to scan a directory for the appearance of a file, then process the file and delete it.

    You can do something like this to transfer between Windows and Linux.

    Remember to have sufficient delay (say 1/2 to 1 minute) between the appearance of the file and processing it, otherwise you may end up with an empty file and errors.

    Probably the simplest solution is to have a Windows / D3 directory shared across the network and map it from your Linux Desktop.

    Create a specific directory on the Windows/D3 system and network share it. In the D3 account, create a super Q-pointer to that directory.

    This will also work no matter the desktop environment.

    Regards,

    Warwick



    ------------------------------
    Warwick Dreher
    Warwick Dreher
    Croydon AU
    ------------------------------



  • 8.  RE: File transfers

    PARTNER
    Posted 21 days ago

    If you're D3 is running on a Linux system, Warwick's suggestion can be achieved using inotify which Linux offers and which will sort out the directory monitoring for you. The other thing I've done when using a watched directory is to have D3 write the file to be transferred and then, when it's done, write an empty (or very small file) that the monitoring process looks for as the trigger to start the transfer. That way you can be sure that the main file is complete.

    So, for example, if D3 writes out a file called mytransfer.txt, have it subsequently write a file called mytransfer.done and have the monitoring process run once it sees the ".done" file appear (and then delete both when the transfer has completed).



    ------------------------------
    Martin Shields
    Senior Technical Consultant
    Meier Business Systems PTY LTD
    Carnegie VIC AU
    ------------------------------