copy file from window server

John

Member
Hello Team,

I have a requirement to move file from a windows server to unix server. Can someone suggest how to include code for this in .p ? Thank You.
 

Cringer

ProgressTalk.com Moderator
Staff member
Which Progress version, for starters? You have a couple of options I can think of. OS-COPY would be one, although I'm not sure it works with UNC paths. Alternatively create a robocopy script on the windows server that does the copy and fire that off with OS-COMMAND.
 

John

Member
Which Progress version, for starters? You have a couple of options I can think of. OS-COPY would be one, although I'm not sure it works with UNC paths. Alternatively create a robocopy script on the windows server that does the copy and fire that off with OS-COMMAND.
Thanks for your reply. We are using 10.2b.
Could you please provide some sample code for both approaches you mentioned? Thanks in advance
 

Cringer

ProgressTalk.com Moderator
Staff member
I have no idea about the requirements. But in essence, create a batch file that does the copy using robocopy, then OS-COMMAND SILENT VALUE(path to batch file). Or something like that.
 

John

Member
Thank You.
Requirement is write a .p program which will do following,
1. get the file from WINDOWS server [D:\]
2. Copy this file to unix server [/home/us]
3. Delete the file from WINDOWS server [D:\] once it is copied to unix server [/home/us]
 

Rob Fitzpatrick

ProgressTalk.com Sponsor
Apart from the code, you need to understand how the file sharing is set up between the servers, if at all. That could be a samba or NFS share on the unix side, exposed as a network path (UNC path or mapped drive) on Windows. Or it could be a CIFS mount on the unix side, exposing a Windows share as a mount point on unix.

A third possibility is that there is no direct sharing between machines. In that case you could use a network share, e.g. a location on a NAS, that is accessible from both servers. You could have the code push the file from one side, and have some process on the other side pull down the file, e.g. by cron job or scheduled task. But we don't know your requirements so that may not be feasible.

Check with your system administrator on how file sharing is set up for you.

Apart from file shares, there are options for file copying like sftp and rsync that can be automated.
 

RealHeavyDude

Well-Known Member
Just my 2 cents:

Your information about your environment is much to vague.

You need to find out what tools or possibilities you have to copy a file from the Windows box to the Unix/Linux box before even attempt to come up with a solution wrapped by ABL functionality. This has nothing to do with Progress OpenEdge - it is know how that you should reach out to your system administrators for if you don't have it.

A solution that involves 3rd party software like sftp or rsync is completely different than "just" copying a file from one UNC path to another when you are able to work with network shares.
 
Thank You.
Requirement is write a .p program which will do following,
1. get the file from WINDOWS server [D:\]
2. Copy this file to unix server [/home/us]
3. Delete the file from WINDOWS server [D:\] once it is copied to unix server [/home/us]
If you have ftp access to your unix server you can write a .bat file and call it from abl with os-command.
 
Top